import { useQuery } from '@tanstack/react-query';
import { apiClient } from '../lib/api';

/**
 * Hook to fetch available TTS languages from the API.
 * Languages are cached indefinitely since they don't change.
 */
export function useLanguages() {
  return useQuery({
    queryKey: ['tts-languages'],
    queryFn: () => apiClient.getLanguages(),
    staleTime: Infinity, // Languages don't change
    refetchOnWindowFocus: false,
  });
}
