import { Line, LineChart, ResponsiveContainer, Tooltip, XAxis, YAxis, } from "recharts"; import { Card, CardContent, CardHeader, CardTitle, } from "../../../shared/ui/card"; import type { AudioSample } from "../../../entities/audioSample/model/types"; import { formatTimeHHMMSS } from "../../../shared/lib/time"; type Props = { history: AudioSample[]; }; type ChartPoint = { timeMs: number; freq_hz: number; }; export function FrequencyHistoryChart({ history }: Props) { const data: ChartPoint[] = history.map((s) => ({ timeMs: s.timeMs, freq_hz: s.freq_hz, })); return ( Frequency (last 60s)
formatTimeHHMMSS(Number(v))} tick={{ fontSize: 12 }} /> formatTimeHHMMSS(Number(v))} formatter={(v) => [`${Number(v).toFixed(0)} Hz`, "freq"]} />
); }