/** * Static map: ISO 3166-1 alpha-2 country code → SVG React component. * * Re-exports every flag from `country-flag-icons` (~270 entries) so the * `Flag` component covers every consumer — locale switchers, phone-input * country picker, country select, etc. Tree-shaking keeps unused flags out * of the final bundle when consumers reach for `` * directly with a constant code. */ import type * as React from 'react'; import * as Flags from 'country-flag-icons/react/3x2'; /** * `country-flag-icons` types its components against `HTMLSVGElement` * (their custom intersection of HTMLElement + SVGElement). We treat them * as opaque components — call sites use `` rather than touching * the DOM type directly. */ export type FlagSvgComponent = (props: React.SVGProps & React.HTMLAttributes) => React.JSX.Element; export const FLAG_COMPONENTS = Flags as unknown as Record;