From 1e9f25e61dc019cb927287e99eae55c7e5026edc Mon Sep 17 00:00:00 2001 From: honzapatCZ Date: Mon, 7 Oct 2024 15:39:11 +0200 Subject: [PATCH] add Flag --- Flag.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Flag.tsx diff --git a/Flag.tsx b/Flag.tsx new file mode 100644 index 0000000..799775c --- /dev/null +++ b/Flag.tsx @@ -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 ( + ...}> + + + ); +} \ No newline at end of file