move flag
This commit is contained in:
parent
84868b3d52
commit
db786e3cd3
12
Parts/Flag.tsx
Normal file
12
Parts/Flag.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user