import { t } from '@/i18n'; import { cn } from '@/lib/cn'; import { MAP_HEIGHT, MAP_WIDTH, isoLookupFromCountries, worldPaths } from '@/lib/map-geo'; import type { CountrySummary } from '@/lib/types'; /** * Server-rendered world map highlighting a group's members (accent) against the other countries (surface-2). * Static SVG — no hover layer needed, the members table below carries the detail. */ export function MemberMap({ members, countries, name, className }: { members: string[]; countries: CountrySummary[]; name: string; className?: string }) { const { paths, sphere } = worldPaths(); const numeric = isoLookupFromCountries(countries as Array<{ id: string; iso_numeric?: string | null }>); const set = new Set(members); const summary = t('region.map.summary', { n: members.length, name }); return (
{summary} {paths.map((p, i) => { const iso3 = p.iso3 ?? (p.numeric ? numeric.get(p.numeric) ?? null : null); const on = iso3 ? set.has(iso3) : false; return ; })}
{name} {t('chart.legend.noData')}
); }