import Link from 'next/link';
import type { ReactNode } from 'react';
import { cn } from '@/lib/cn';
import { fmtAgo } from '@/lib/format';
import { routes } from '@/lib/site';
import { FreshnessBadge } from '@/components/ui/badges';
import type { StatsSnapshot } from '@/lib/types';
/** "derived" tag with a link to the methodology page — mandatory next to every computed metric. */
export function Derived({ className, what }: { className?: string; what?: string }) {
return (
derived
);
}
/** Short explanatory note under a chart or table. `tone="warn"` renders a left rule for disclaimers. */
export function Note({ children, tone = 'muted', className }: { children: ReactNode; tone?: 'muted' | 'warn'; className?: string }) {
return (
{children}
);
}
/** Prominent disclaimer block (debris / reentries pages). Text is shown verbatim from the API. */
export function Disclaimer({ text, label = 'Disclaimer' }: { text: string; label?: string }) {
return (
{label}
{text}
);
}
/** Responsive grid of `Stat` tiles separated by a hairline on top. */
export function StatGrid({ children, cols = 4, className }: { children: ReactNode; cols?: 3 | 4 | 5; className?: string }) {
const c = cols === 3 ? 'sm:grid-cols-3' : cols === 5 ? 'sm:grid-cols-3 lg:grid-cols-5' : 'sm:grid-cols-3 lg:grid-cols-4';
return
{children}
;
}
/** Group title inside a section (e.g. "Catalogue", "Decays"). */
export function GroupTitle({ children, hint }: { children: ReactNode; hint?: ReactNode }) {
return (