1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-12-08 00:44:30 +01:00
.profile/components/Header/Locales/LocaleFlag.tsx

20 lines
476 B
TypeScript

import { useI18n } from "@/i18n/i18n.client"
import type { CookiesStore } from "@/utils/constants"
export interface LocaleFlagProps {
locale: string
cookiesStore: CookiesStore
}
export const LocaleFlag = (props: LocaleFlagProps): JSX.Element => {
const { locale, cookiesStore } = props
const i18n = useI18n(cookiesStore)
return (
<p data-cy="locale-flag-text" className="mx-2 text-lg font-semibold">
{i18n.translate(`common.${locale}`)}
</p>
)
}