feat: improve instantiation of intl
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user