scoresaber-reloadedv3/projects/website/src/components/country-flag.tsx

18 lines
401 B
TypeScript
Raw Normal View History

2024-09-09 08:33:05 +00:00
type Props = {
code: string;
2024-09-09 08:33:05 +00:00
size?: number;
};
export default function CountryFlag({ code, size = 24 }: Props) {
2024-09-09 08:33:05 +00:00
return (
// eslint-disable-next-line @next/next/no-img-element
2024-09-13 12:45:04 +00:00
<img
alt="Player Country"
src={`/assets/flags/${code.toLowerCase()}.png`}
2024-09-13 12:45:04 +00:00
width={size * 2}
height={size}
className={`w-[${size * 2}px] h-[${size}px] object-contain`}
2024-09-13 12:45:04 +00:00
/>
2024-09-09 08:33:05 +00:00
);
}