export const fetcher = async (url: string) => { const res = await fetch(url); if (!res.ok) { const error = new Error('API request failed'); throw error; } return res.json(); }; export const swrConfig = { revalidateOnFocus: false, revalidateOnReconnect: true, shouldRetryOnError: true, errorRetryCount: 3, dedupingInterval: 5000, };