1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-11-04 00:19:01 +01:00

refactor: components struture

This commit is contained in:
2024-07-31 11:41:39 +02:00
parent ceeeb2f9c5
commit b5c50728de
72 changed files with 122 additions and 114 deletions

View File

@@ -0,0 +1,26 @@
import type { Locale } from "@repo/i18n/config"
import { useTranslations } from "next-intl"
import Image from "next/image"
export interface LocaleFlagProps {
locale: Locale
}
export const LocaleFlag: React.FC<LocaleFlagProps> = (props) => {
const { locale } = props
const t = useTranslations()
return (
<>
<Image
quality={100}
width={35}
height={35}
src={`/images/locales/${locale}.svg`}
alt={`Flag of ${t(`locales.${locale}`)}`}
/>
<p className="mx-2 text-base font-semibold">{t(`locales.${locale}`)}</p>
</>
)
}