import { motion } from "motion/react"; import type { Snapshot } from "../../api"; import { formatBytes, formatWhen } from "../../lib/format"; export function VaultRing({ snapshots, onSelect, onCapture, capturing, }: { snapshots: Snapshot[]; onSelect: (id: string) => void; onCapture?: () => void; capturing?: boolean; }) { const count = Math.max(snapshots.length, 1); const radius = 128; const tiles = snapshots.slice(0, 16); return (
Vault {snapshots.length} snapshot{tiles.length === 1 ? "" : "s"} {tiles.length === 0 && ( Capture your first orbit )} {tiles.map((snap, i) => { const angle = (i / Math.max(count, tiles.length)) * Math.PI * 2 - Math.PI / 2; const x = Math.cos(angle) * radius; const y = Math.sin(angle) * radius; return ( onSelect(snap.id)} > {snap.orbit_name} · {formatWhen(snap.taken_at)} ); })}
{onCapture && ( {capturing ? "Orbit in progress…" : "Capture now"} )}

Select tile · stardust delta only

); } export function SnapshotSummaryRow({ snap }: { snap: Snapshot }) { return (
{snap.orbit_name} {formatBytes(snap.size_bytes)}
); }