"use client"; type KeyInviteeItem = { no: number; name: string; designation: string; organization: string; category: string; country: string; }; type Props = { data: { id: string; eyebrow: string; title: string; items: KeyInviteeItem[]; }; }; const getFlagUrl = (country: string) => { const mapping: Record = { Vietnam: "vn", Malaysia: "my", Indonesia: "id", Laos: "la", China: "cn", }; const code = mapping[country]; return code ? `https://flagcdn.com/w40/${code}.png` : null; }; const CountryFlag = ({ country }: { country: string }) => { const url = getFlagUrl(country); if (url) { return ( // eslint-disable-next-line @next/next/no-img-element {country} ); } // Beautiful gold region globe SVG for APAC if (country === "APAC") { return ( ); } // Global fallback SVG return ( ); }; export default function KeyInviteesSection({ data }: Props) { return (
{/* Section Header */}
{data.eyebrow}

{data.title}

{/* Cards Grid */}
{data.items.map((item) => (
{/* Background glowing gradient decoration */}
{/* Top Row: No & Category Badge */}
#{String(item.no).padStart(2, "0")} {item.category}
{/* Middle: Invitee Name & Title */}

{item.name}

{item.designation}

{item.organization}

{/* Bottom Row: Country Info */}
{item.country}
))}
); }