import type { RenderResult } from '../hooks/useRenderer'; export default function DiagnosticsPanel({ result }: { result: RenderResult }) { const d = result.diag; const modes = Array.from(result.modeF); const shown = modes.slice(0, 10); return (
Strikes {d.strikeCount === 1 ? `single, ${d.meanV.toFixed(2)} m/s` : `${d.strikeCount} · mean ${d.meanV.toFixed(2)} m/s, max ${d.maxV.toFixed(2)} m/s`}
Contact {d.meanTauUs.toFixed(0)} µs mean (Hertz) · peak force {d.peakForceN.toFixed(0)} N
Rod modes {shown.map((f) => f.toFixed(0)).join(', ')} {modes.length > shown.length ? `, … (${modes.length} total)` : ''} Hz
Families {d.modesIn} in-plane, {d.modesOut} out-of-plane
Listener {(d.listenerDistM * 100).toFixed(0)} cm from the frame
Peak pressure {d.peakPa.toFixed(3)} Pa ({d.peakSplDb.toFixed(1)} dB SPL)
Length {d.durationS.toFixed(2)} s · {result.quality} · oversample {d.oversample}
eigensolve: {d.solveCached ? 'cached' : `${(d.solveMs / 1000).toFixed(2)} s`} · radiation:{' '} {d.radiateCached ? 'cached' : `${(d.radiateMs / 1000).toFixed(2)} s`}
{d.warnings.map((w, i) => (
⚠ {w}
))}
); }