import type { ReactNode } from 'react'; export interface CompareRow { /** The dimension being compared — the row's label. */ dimension: string; /** The unmarked side: what happens without the product. */ without: string; /** The marked side. Always rendered with its mark AND its words. */ with: string; } export interface ComparePanelProps { rows: CompareRow[]; /** Column headings. Defaults to no header row at all. */ headings?: [string, string]; children?: ReactNode; className?: string; } /** * The mist panel — the one place below the hero where a real fill appears. * `--panel` at `--radius-lg`, hairline rows, and one mark per row on the * marked side. * * Ink measures 9.76:1 on `--panel`, so the panel is safe for body copy; it is * the only surface in the pack besides `--surface` that is. * * The marked side always carries its phrase. A column of bare accent dots is a * legend a reader with protanopia cannot use — see `StatusPill` for the * measurements — and it is also just worse writing. */ export function ComparePanel({ rows, headings, children, className }: ComparePanelProps) { return (
{headings !== undefined && ( )} {rows.map((row) => ( ))}
{headings[0]} {headings[1]}
{row.dimension} {row.without}
{children}
); }