{status?.busy && (
)}
{status?.text ?? ""}
{status?.action &&
{note?.text ?? ""}
); } /* ---- chips ------------------------------------------------------------------- */ export interface Explain { text: string; say: Say; tone?: Tone; } /** * A chip whose meaning would otherwise live in a tooltip. Touch has no hover, * so the chip becomes a button that writes its sentence into the row's own * status slot, and a second tap takes it away. */ function useExplain(explain: Explain | undefined) { const [open, setOpen] = useState(false); if (!explain) { return {}; } const toggle = (event: MouseEvent | KeyboardEvent) => { event.stopPropagation(); event.preventDefault(); const next = !open; setOpen(next); explain.say(next ? explain.text : null, explain.tone); }; return { role: "button", tabIndex: 0, "data-explain": "", "aria-expanded": open, onClick: toggle, onKeyDown: (event: KeyboardEvent) => { if (event.key === "Enter" || event.key === " ") { toggle(event); } }, }; } export interface ChipProps extends HTMLAttributes{short}
{more !== undefined && ( <>{more}
> )}