// ───────────────────────────────────────────────────────────────────────────── // features/home/hooks/useFeatureCards.ts // // Server state for the feature cards grid on the Home dashboard. // Swap `fetchFeatureCards` for a real API endpoint when ready. // ───────────────────────────────────────────────────────────────────────────── import { useQuery } from '@tanstack/react-query'; import { useLanguage } from 'xertica-ui/hooks'; import { fetchFeatureCards, type FeatureCard } from '../data/mock'; export function useFeatureCards() { const { language } = useLanguage(); return useQuery({ // Language is part of the key so each locale has its own cache slot. queryKey: ['home', 'feature-cards', language], queryFn: fetchFeatureCards, staleTime: 10 * 60 * 1000, // 10 min — feature list is fairly static }); }