import React from 'react'; import type { ScanHistoryResponse, WeeklyReportResponse, } from '../../service/visibility/visibility.interface'; import KPIRow from './KPIRow'; import ScanHistoryChart from './ScanHistoryChart'; interface OverviewPulseProps { weeklyReport: WeeklyReportResponse | null; scanHistory: ScanHistoryResponse | null; weekIso: string; loading: boolean; } function OverviewPulse({ weeklyReport, scanHistory, weekIso, loading, }: OverviewPulseProps): JSX.Element { // Prompt counts live on the scan-history row, not the weekly report, so the // "mentioned in N of M prompts" footnote is read from the point matching // the selected week (falling back to the most recent one). const history = scanHistory?.history ?? []; const point = history.find(scanPoint => scanPoint?.week_iso === weekIso) ?? history[history.length - 1] ?? null; return (
); } export default OverviewPulse;