import { apiRequest } from "@/lib/queryClient";

export interface Language {
	code: string;
	name: string;
	nativeName: string;
}

/**
 * API Client for language-related operations
 * Provides type-safe methods for all language API endpoints
 */
export const languageApiClient = {
	// Language operations
	async getLanguages(): Promise<Language[]> {
		return apiRequest<Language[]>("GET", "/api/languages");
	},

	async getLanguage(code: string): Promise<Language> {
		return apiRequest<Language>("GET", `/api/languages/${code}`);
	},
};
