// ───────────────────────────────────────────────────────────────────────────── // features/assistant/hooks/useAssistantConfig.ts // // Server state for the XerticaAssistant configuration (suggestions, feedback // options). Swap `fetchAssistantConfig` for a real API endpoint when ready. // ───────────────────────────────────────────────────────────────────────────── import { useQuery } from '@tanstack/react-query'; import { useLanguage } from 'xertica-ui/hooks'; import { fetchAssistantConfig, type AssistantConfig } from '../data/mock'; export function useAssistantConfig() { const { language } = useLanguage(); return useQuery({ // Language is part of the key so each locale has its own cache slot. queryKey: ['assistant', 'config', language], queryFn: fetchAssistantConfig, staleTime: 30 * 60 * 1000, // 30 min — config rarely changes }); }