'use client'; import { SeriesChart } from '@/components/charts/SeriesChart'; import type { SimpleSeries } from '@/lib/types'; /** 24 h pressure line for a scope with its 7-day baseline median / p90 as dashed references. */ export function ScopePressureChart({ series, baseline, height = 220 }: { series: SimpleSeries; baseline?: { median: number; p90: number }; height?: number }) { const pts = series.points.map((p) => ({ ts: p.ts, value: p.pressure })); const lines = [{ name: 'Pressure', color: '#E6EDF3', points: pts, area: true, width: 1.5 }]; if (baseline && pts.length) { lines.push({ name: '7d median', color: '#5B6875', points: pts.map((p) => ({ ts: p.ts, value: baseline.median })), area: false, width: 1, dashed: true } as (typeof lines)[number]); lines.push({ name: '7d p90', color: '#8B98A5', points: pts.map((p) => ({ ts: p.ts, value: baseline.p90 })), area: false, width: 1, dashed: true } as (typeof lines)[number]); } return ; }