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 [];
}
