fix(BOOK-399): Default language to 'en' when we've ended up in a invalid state * fix(BOOK-399): Default language to 'en' when we've ended up in a invalid state * PR fixes: reuse types and include local dev error message Approved-by: Anton Gunnarsson Approved-by: Linus Flood
27 lines
567 B
TypeScript
27 lines
567 B
TypeScript
"use client"
|
|
|
|
import { type IntlConfig, IntlProvider } from "react-intl"
|
|
|
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
|
|
|
export type ClientIntlProviderProps = React.PropsWithChildren<
|
|
Pick<IntlConfig, "defaultLocale" | "messages"> & { locale: Lang }
|
|
>
|
|
|
|
export default function ClientIntlProvider({
|
|
children,
|
|
locale,
|
|
defaultLocale,
|
|
messages,
|
|
}: ClientIntlProviderProps) {
|
|
return (
|
|
<IntlProvider
|
|
locale={locale}
|
|
defaultLocale={defaultLocale}
|
|
messages={messages}
|
|
>
|
|
{children}
|
|
</IntlProvider>
|
|
)
|
|
}
|