import type { ReactNode } from 'react'; export interface InstrumentProps { /** The reading's subject line — an id, a request, a device. */ title?: string; /** The mono micro-label stating a condition about the data itself. */ badge?: string; /** * The alarm state: the instrument re-skins itself dark because of what it * DETECTED, never because a user asked for dark. Wiring this to a theme * toggle or to prefers-color-scheme destroys the pack's one idea. */ alarm?: boolean; children: ReactNode; className?: string; } export function Instrument({ title, badge, alarm = false, children, className }: InstrumentProps) { return (
{(title !== undefined || badge !== undefined) && (
{title !== undefined && {title}} {badge !== undefined && {badge}}
)}
{children}
); }