import { Popup } from 'react-map-gl/maplibre'; import { useTranslation } from 'react-i18next'; import { CG_TYPE_LABEL } from '../../services/coastGuard'; import type { CoastGuardFacility, CoastGuardType } from '../../services/coastGuard'; const TYPE_COLOR: Record = { hq: '#ff6b6b', regional: '#ffa94d', station: '#4dabf7', substation: '#69db7c', vts: '#da77f2', navy: '#3b82f6', }; interface Props { selected: CoastGuardFacility | null; onClose: () => void; } export function CoastGuardLayer({ selected, onClose }: Props) { const { t } = useTranslation(); if (!selected) return null; return (
{selected.type === 'navy' ? ( ) : selected.type === 'vts' ? ( 📡 ) : ( 🚔 )} {selected.name}
{CG_TYPE_LABEL[selected.type]} {t('coastGuard.agency')}
{selected.lat.toFixed(4)}°N, {selected.lng.toFixed(4)}°E
); }