mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-24 06:58:10 -05:00
27 lines
519 B
TypeScript
27 lines
519 B
TypeScript
import clsx from "clsx";
|
|
import { useTranslation } from "react-i18next";
|
|
import { countryCodeToTranslatedName } from "~/utils/i18n";
|
|
|
|
export function Flag({
|
|
countryCode,
|
|
tiny = false,
|
|
}: {
|
|
countryCode: string;
|
|
tiny?: boolean;
|
|
}) {
|
|
const { i18n } = useTranslation();
|
|
|
|
return (
|
|
<div
|
|
className={clsx(`twf twf-${countryCode.toLowerCase()}`, {
|
|
"twf-s": tiny,
|
|
})}
|
|
data-testid={`flag-${countryCode}`}
|
|
title={countryCodeToTranslatedName({
|
|
countryCode,
|
|
language: i18n.language,
|
|
})}
|
|
/>
|
|
);
|
|
}
|