import type { AisTarget } from "../../entities/aisTarget/model/types"; import type { LegacyVesselInfo } from "../../entities/legacyVessel/model/types"; import { fmtIsoFull } from "../../shared/lib/datetime"; type Props = { target: AisTarget; legacy?: LegacyVesselInfo | null; onClose: () => void; }; export function AisInfoPanel({ target: t, legacy, onClose }: Props) { const name = (t.name || "").trim() || "(no name)"; return (
{name}
MMSI {t.mmsi} · {t.vesselType || "Unknown"} · Class {t.classType || "?"}
{legacy ? (
CN Permit Match
업종 {legacy.shipCode} ·{" "} 허가번호 {legacy.permitNo}
허가수역 {legacy.workSeaArea || "-"} ·{" "} 톤수 {legacy.ton ?? "-"}
{legacy.ownerCn || legacy.ownerRoman ? (
소유주{" "} {legacy.ownerCn || legacy.ownerRoman} {legacy.ownerCn && legacy.ownerRoman ? ({legacy.ownerRoman}) : null}
) : null} {legacy.pairPermitNo ? (
{legacy.pairPermitNo} {legacy.pairShipNameCn ? · {legacy.pairShipNameCn} : null}
) : null}
) : null}
SOG {t.sog ?? "?"} kt
COG {t.cog ?? "?"}°
Heading {t.heading ?? "?"}°
Status {t.status || "N/A"}
Position {Number.isFinite(t.lat) ? t.lat.toFixed(5) : "?"}, {Number.isFinite(t.lon) ? t.lon.toFixed(5) : "?"}
Dest {(t.destination || "").trim() || "-"}
ETA {t.eta || "-"}
Msg TS {fmtIsoFull(t.messageTimestamp)}
Received {fmtIsoFull(t.receivedDate)}
); }