SPB Git

Repository Public

Readouts.tsx 915 B 24 lines tsx

1import type { Tone } from "@/schema";2import { Inline } from "@/renderer/inline";34export interface Readout { label: string; value: string; tone?: Tone; hint?: string }56/** The numbers a simulation reports, as real text (readable by screen readers, selectable, printable). */7export function Readouts({ items }: { items: Readout[] }) {8  return (9    <dl className="sim-stats">10      {items.map((it) => (11        <div key={it.label} className="sim-stat" data-tone={it.tone}>12          <dt><Inline text={it.label} /></dt>13          <dd style={it.tone ? { color: `var(--sh-t-${it.tone})` } : undefined}>{it.value}</dd>14          {it.hint ? <dd className="sim-stat-hint"><Inline text={it.hint} /></dd> : null}15        </div>16      ))}17    </dl>18  );19}2021export function Note({ tone, children }: { tone?: "warn"; children: string }) {22  return <p className="sim-note" data-tone={tone}><Inline text={children} /></p>;23}24
Files main
Menu

Theme