import { useQuery } from "@tanstack/react-query";
import { languageApiClient } from "@/api/language-api-client";

// Query hooks for languages
export function useLanguages() {
	return useQuery({
		queryKey: ["languages"],
		queryFn: () => languageApiClient.getLanguages(),
	});
}

export function useLanguage(code: string) {
	return useQuery({
		queryKey: ["language", code],
		queryFn: () => languageApiClient.getLanguage(code),
		enabled: !!code,
	});
}
