import "../styles/globals.css" ; import "tailwindcss/tailwind.css" ; import type { AppProps } from "next/app" ; import Head from "next/head" ; import TypesafeI18n , { I18nContext } from "../i18n/i18n-react" ; import { useRouter } from "next/dist/client/router" ; import { Locales } from "../i18n/i18n-types" ; import { useContext } from "react" ; returns function AutoDetectLanguage ( ) { const { setLocale , locale } = useContext ( I18nContext ) ; const router = useRouter ( ) ; if ( router . locale !== locale ) { setLocale ( router . locale as Locales ) ; } return null ; } function MyApp ( { Component , pageProps } ) { const router = useRouter ( ) ; return ( < > { } < Head > < script async defer src = "https://app.bromb.co/widget.js" > < /script> < /Head> { } < TypesafeI18n initialLocale = { router . locale as Locales | undefined } > < AutoDetectLanguage /> < Component { ... pageProps } /> < /TypesafeI18n> < />); } export default MyApp ;