This commit is contained in:
honzapatCZ 2024-10-07 15:39:11 +02:00
parent 6ff38df1ce
commit 1e9f25e61d

12
Flag.tsx Normal file
View File

@ -0,0 +1,12 @@
import { Country } from "@services/accounting-api";
import { lazy, Suspense } from 'react';
export default function Flag({ country, ...props }: { country: Country | "EU" }) {
const FlagIcon = lazy(() => import(`country-flag-icons/react/3x2`).then(module => ({ default: module[country] })));
return (
<Suspense fallback={<div {...props}>...</div>}>
<FlagIcon {...props}/>
</Suspense>
);
}