import type { ReactNode } from 'react'; export interface TerminalTab { id: string; label: string; command: string; } export interface TerminalProps { tabs: TerminalTab[]; /** Which tab's command is showing. The component is presentational. */ activeId?: string; onSelect?: (id: string) => void; /** The prompt glyph. `$` in the reference. */ prompt?: string; /** A copy affordance that reports in place, never a toast. */ action?: ReactNode; className?: string; } export function Terminal({ tabs, activeId, onSelect, prompt = '$', action, className, }: TerminalProps) { const active = tabs.find((t) => t.id === activeId) ?? tabs[0]; return (
{active?.command}
{action}