import Link from 'next/link'; import { fmtDate, fmtInt, num } from '@/lib/format'; import { routes } from '@/lib/site'; import type { LaunchRow } from '@/lib/types'; /** Launch rows (list page, site detail, launch detail siblings). `ownerHref` lets the caller scope owner chips to its context. */ export function LaunchesTable({ rows, ownerHref = (code) => routes.launches(`owner=${encodeURIComponent(code)}`), showSite = true }: { rows: LaunchRow[]; ownerHref?: (code: string) => string; showSite?: boolean }) { return (
| Date | COSPAR | Primary payload | Payloads | Objects | On orbit | {showSite &&Site | }Owners |
|---|---|---|---|---|---|---|---|
| {fmtDate(l.launch_date)} | {l.cospar_launch_id} | {l.primary_name ?? unnamed} | {fmtInt(l.payload_count)} | {fmtInt(l.object_count)} | {fmtInt(l.on_orbit_count)} | {showSite &&{l.site_slug ? {l.site_name} : l.site_name ?? '—'} | }{owners.length ? ( {owners.slice(0, 4).map((c) => ( {c} ))} {owners.length > 4 && +{owners.length - 4}} ) : ( '—' )} |