feat: improve instantiation of intl

This commit is contained in:
Michael Zetterberg
2025-04-07 07:33:28 +02:00
parent f31b374370
commit 7c82a565ae
11 changed files with 95 additions and 65 deletions

View File

@@ -2,11 +2,21 @@
import { IntlProvider } from "react-intl"
import type { ServerIntlProviderProps } from "@/types/i18n"
import type { ClientIntlProviderProps } from "@/types/i18n"
export default function ServerIntlProvider({
export default function ClientIntlProvider({
children,
intl,
}: ServerIntlProviderProps) {
return <IntlProvider {...intl}>{children}</IntlProvider>
locale,
defaultLocale,
messages,
}: ClientIntlProviderProps) {
return (
<IntlProvider
locale={locale}
defaultLocale={defaultLocale}
messages={messages}
>
{children}
</IntlProvider>
)
}