import { Popup } from 'react-map-gl/maplibre'; import { useTranslation } from 'react-i18next'; import { NW_LEVEL_LABEL, NW_ORG_LABEL } from '../../services/navWarning'; import type { NavWarning, NavWarningLevel, TrainingOrg } from '../../services/navWarning'; const LEVEL_COLOR: Record = { danger: '#ef4444', caution: '#eab308', info: '#3b82f6', }; const ORG_COLOR: Record = { '해군': '#8b5cf6', '해병대': '#22c55e', '공군': '#f97316', '육군': '#ef4444', '해경': '#3b82f6', '국과연': '#eab308', }; interface Props { selected: NavWarning | null; onClose: () => void; } export function NavWarningLayer({ selected, onClose }: Props) { const { t } = useTranslation(); if (!selected) return null; return (
{selected.title}
{NW_LEVEL_LABEL[selected.level]} {NW_ORG_LABEL[selected.org]} {selected.area}
{selected.description}
{t('navWarning.altitude')}: {selected.altitude}
{selected.lat.toFixed(4)}°N, {selected.lng.toFixed(4)}°E
{t('navWarning.source')}: {selected.source}
{t('navWarning.khoaLink')}
); }