18 lines
402 B
TypeScript
18 lines
402 B
TypeScript
import {
|
|
InternetProviderLyricSearchResponse,
|
|
getSearchResults,
|
|
} from "@/lib/actions/lyrics";
|
|
|
|
export async function searchSongs(
|
|
_currentState: InternetProviderLyricSearchResponse[],
|
|
formData: FormData
|
|
): Promise<InternetProviderLyricSearchResponse[]> {
|
|
const list = await getSearchResults({
|
|
name: formData.get("name") as string,
|
|
});
|
|
if (list) {
|
|
return list;
|
|
}
|
|
return [];
|
|
}
|