import { usePositionStore } from '../stores/positionStore' import { getShipKindLabel, getShipKindColor } from '../../vessel-map/utils/shipKindColors' interface VesselPopupProps { onTrackQuery?: (mmsi: string) => void } export default function VesselPopup({ onTrackQuery }: VesselPopupProps) { const selectedMmsi = usePositionStore((s) => s.selectedMmsi) const positions = usePositionStore((s) => s.positions) const selectVessel = usePositionStore((s) => s.selectVessel) if (!selectedMmsi) return null const vessel = positions.get(selectedMmsi) if (!vessel) return null const kindLabel = getShipKindLabel(vessel.shipKindCode) const kindColor = getShipKindColor(vessel.shipKindCode) return (
{/* 헤더 */}
{vessel.shipNm || vessel.mmsi}
{/* 선박 정보 그리드 */}
{vessel.imo ? : null}
{/* 선박 사진 */} {vessel.shipImagePath && (
{vessel.shipNm { (e.target as HTMLImageElement).style.display = 'none' }} />
)} {/* 항적 조회 버튼 */} {onTrackQuery && ( )}
) } function InfoRow({ label, value }: { label: string; value: string }) { return ( <> {label} {value} ) }