import Link from 'next/link'; import { MissionLabel, OrbitBadge, StatusBadge, TypeBadge } from '@/components/ui/badges'; import { Unavailable } from '@/components/ui/unavailable'; import { fmt1, fmtAgo, fmtDate, fmtDateTime, fmtDeg, fmtInt, fmtKm, fmtMinutes, titleCase } from '@/lib/format'; import { EVENT_TYPE_LABELS, OBJECT_TYPE_LABELS, routes } from '@/lib/site'; import type { SatelliteDetail, SatelliteHistory } from '@/lib/types'; import { AltitudeChart } from './altitude-chart'; import { OPS_STATUS } from './hero'; import { Block, Chip, DL, Derived, Empty, Head, Note, Row } from './primitives'; const sci = (v: number | null) => (v === null ? '—' : v === 0 ? '0' : v.toExponential(4)); export function OrbitSection({ d, history }: { d: SatelliteDetail; history: SatelliteHistory | null }) { const os = d.orbital_state; const series = history?.altitude_series ?? []; return ( {os ? (
= 120 ? `(${fmtMinutes(os.period_minutes)})` : undefined} /> Orbit class } mono={false} value={} />

Epoch {fmtDateTime(os.epoch)} · received {fmtAgo(os.updated_at)} from {titleCase(os.source_id)}. Mean Keplerian elements (SGP4 / TLE convention, TEME frame); perigee and apogee are altitudes above the WGS-84 equatorial radius.

) : ( No orbital element set is available for this object{d.status === 'DECAYED' ? ' — it decayed' + (d.decay_date ? ` on ${fmtDate(d.decay_date)}` : '') + ' and is no longer propagated' : ''}. Catalogue values above (if any) come from the SATCAT record. )}

Orbital history

{history === null ? ( ) : series.length >= 2 ? ( ) : ( {series.length === 1 ? '1 daily point on file so far. ' : os ? '' : 'No element sets on file. '} History accumulates as element sets are ingested (every 2 h); altitude, period and inclination trends appear here once at least two days are available. )}
); } export function MissionSection({ d }: { d: SatelliteDetail }) { return (
Mission type } mono={false} value={} /> {d.ops_status_code && {OPS_STATUS[d.ops_status_code] ?? 'Code'} [{d.ops_status_code}]} />} {d.constellation_memberships.length > 0 && ( Constellation membership } mono={false} value={d.constellation_memberships.map((m) => {m.name} via {m.method})} /> )}

CelesTrak groups

{d.tags.length ? (
    {d.tags.map((t) => (
  • {t.tag}
  • ))}
) : ( Not listed in any CelesTrak group. )}

Aliases

{d.aliases.length ? (
    {d.aliases.map((a) => (
  • {a.alias} {titleCase(a.source_id)}
  • ))}
) : ( No alternative names recorded. )}
); } export function OwnershipSection({ d }: { d: SatelliteDetail }) { return (
{d.operator_name} : '—'} /> {d.owner_code}{d.owner_name && · {d.owner_name}} : '—'} /> {d.country_name} {d.country_code} : d.owner_code === 'ISS' ? 'International partnership' : '—'} />
); } export function LaunchSection({ d }: { d: SatelliteDetail }) { const sib = d.launch_siblings; const shown = sib.slice(0, 12); return (
{d.cospar_launch_id} : '—'} /> {d.launch_site_name} : d.launch_site_code ?? '—'} />

Objects from the same launch{sib.length ? · {fmtInt(sib.length)}{sib.length >= 40 ? '+' : ''} : null}

{shown.length ? ( ) : ( No other catalogued object is linked to this launch. )} {d.cospar_launch_id && sib.length > shown.length && ( All objects from launch {d.cospar_launch_id} → )}
); } export function HistorySection({ d }: { d: SatelliteDetail }) { return ( {d.history.length ? ( {d.history.map((h, i) => ( ))}
FieldChangeSourceDate
{titleCase(h.field)} {h.old_value ?? '∅'} → {h.new_value ?? '∅'} {titleCase(h.source_id)} {fmtDateTime(h.changed_at)}
) : ( No changes recorded since first ingestion on {fmtDateTime(d.first_seen_at)}. Status, orbit class, name and ownership changes are logged here as sources are re-ingested. )}
); } export function RegistrationSection() { return ( ); } export function SourcesSection({ d }: { d: SatelliteDetail }) { const sources = Array.from(new Map(d.sources.map((s) => [s.id, s])).values()); const byField = new Map(); for (const p of d.provenance) byField.set(p.field_name, [...(byField.get(p.field_name) ?? []), p]); return ( {sources.length ? ( ) : ( No source is linked to this record yet — the catalogue row exists but no provenance entry has been written for it. )}

Field provenance

{byField.size ? ( {Array.from(byField.entries()).flatMap(([field, rows]) => rows.map((p, i) => ( )), )}
FieldSourceObservedConfidence
{i === 0 ? titleCase(field) : ↳ {titleCase(field)}} {p.source_name} {fmtDateTime(p.observed_at)} {(p.confidence * 100).toFixed(0)}%
) : ( No field-level provenance recorded. )} {d.quality_flags.length > 0 && ( <>

Quality flags

)}
); } export function EventsSection({ d }: { d: SatelliteDetail }) { return ( {d.events.length ? (
    {d.events.map((e) => (
  1. {fmtDateTime(e.event_time)}

    {EVENT_TYPE_LABELS[e.type] ?? titleCase(e.type)}{e.title}

    {e.summary &&

    {e.summary}

    }

    confidence {(e.confidence * 100).toFixed(0)}%{e.source_name && <> · {e.source_url ? {e.source_name} : e.source_name}}

  2. ))}
) : ( No events detected for this object yet. Launches, decays and orbit changes are generated by the derived-analytics connector. )}
); } export function RelatedSection({ d }: { d: SatelliteDetail }) { return ( {d.related.length ? ( ) : ( No related objects (same constellation or operator) found. )} ); } export function IdentifiersSection({ d }: { d: SatelliteDetail }) { return (
{d.id}} /> {d.slug}} /> {d.identifiers.filter((i) => i.identifier_type !== 'norad' && i.identifier_type !== 'cospar').map((i) => ( {i.identifier_value}{i.verified && ✓}} /> ))}
); }