import { Popup } from 'react-map-gl/maplibre'; import type { GovBuilding } from '../../data/govBuildings'; const COUNTRY_STYLE: Record = { CN: { color: '#ef4444', flag: '🇨🇳', label: '중국' }, JP: { color: '#f472b6', flag: '🇯🇵', label: '일본' }, }; const TYPE_STYLE: Record = { executive: { icon: '🏛️', label: '행정부', color: '#f59e0b' }, legislature: { icon: '🏛️', label: '입법부', color: '#a78bfa' }, military_hq: { icon: '⭐', label: '군사본부', color: '#ef4444' }, intelligence: { icon: '🔍', label: '정보기관', color: '#6366f1' }, foreign: { icon: '🌐', label: '외교부', color: '#3b82f6' }, maritime: { icon: '⚓', label: '해양기관', color: '#06b6d4' }, defense: { icon: '🛡️', label: '국방부', color: '#dc2626' }, }; interface Props { selected: GovBuilding | null; onClose: () => void; } export function GovBuildingLayer({ selected, onClose }: Props) { if (!selected) return null; const cs = COUNTRY_STYLE[selected.country] || COUNTRY_STYLE.CN; const ts = TYPE_STYLE[selected.type] || TYPE_STYLE.executive; return (
{cs.flag} {ts.icon} {selected.nameKo}
{ts.label} {cs.label}
{selected.description}
{selected.name}
{selected.lat.toFixed(4)}°N, {selected.lng.toFixed(4)}°E
); }