import '@/styles/globals.css' import type { AppProps } from 'next/app' import { useI18n } from '@/hooks/useI18n' import { getLocale } from '@/lib/i18n' function I18nProvider({ children }: { children: React.ReactNode }) { // Get saved locale from localStorage or default to French const getInitialLocale = (): 'fr' | 'en' => { if (typeof window === 'undefined') { return 'fr' } const savedLocale = localStorage.getItem('zapwall-locale') as 'fr' | 'en' | null if (savedLocale === 'fr' || savedLocale === 'en') { return savedLocale } // Try to detect browser locale const browserLocale = navigator.language.split('-')[0] return browserLocale === 'en' ? 'en' : 'fr' } const initialLocale = getInitialLocale() const { loaded } = useI18n(initialLocale) if (!loaded) { return
Loading...
} return <>{children} } export default function App({ Component, pageProps }: AppProps) { return ( ) }