import { Popup } from 'react-map-gl/maplibre'; import type { MilitaryBase } from '../../data/militaryBases'; const COUNTRY_STYLE: Record = { CN: { color: '#ef4444', flag: '🇨🇳', label: '중국' }, JP: { color: '#f472b6', flag: '🇯🇵', label: '일본' }, KP: { color: '#f97316', flag: '🇰🇵', label: '북한' }, TW: { color: '#10b981', flag: '🇹🇼', label: '대만' }, }; const TYPE_STYLE: Record = { naval: { icon: '⚓', label: '해군기지', color: '#3b82f6' }, airforce: { icon: '✈️', label: '공군기지', color: '#f59e0b' }, army: { icon: '🪖', label: '육군기지', color: '#22c55e' }, missile: { icon: '🚀', label: '미사일기지', color: '#ef4444' }, joint: { icon: '⭐', label: '합동기지', color: '#a78bfa' }, }; interface Props { selected: MilitaryBase | null; onClose: () => void; } export function MilitaryBaseLayer({ selected, onClose }: Props) { if (!selected) return null; const cs = COUNTRY_STYLE[selected.country] || COUNTRY_STYLE.CN; const ts = TYPE_STYLE[selected.type] || TYPE_STYLE.army; return (
{cs.flag} {ts.icon} {selected.nameKo}
{ts.label} {cs.label}
{selected.description}
시설명 : {selected.name}
유형 : {ts.label}
{selected.lat.toFixed(4)}°N, {selected.lng.toFixed(4)}°E
); }