function formatCadCoord(v: number | null): string { if (v === null || !Number.isFinite(v)) return '—'; const abs = Math.abs(v); const digits = abs >= 1e6 ? 1 : abs >= 1e3 ? 2 : abs >= 1 ? 3 : 4; return v.toFixed(digits); } export interface CoordReadoutProps { point: { x: number; y: number; z: number } | null; spaceKind: 'model' | 'paper' | 'other' | null; } export function CoordReadout({ point, spaceKind }: CoordReadoutProps) { const unitLabel = spaceKind === 'paper' ? 'Paper' : 'UCS'; return (