import type { ReactNode } from 'react'; export interface ChatLineProps { /** Speaker name, set in mono above the line. */ who: string; /** Initials for the disc when no portrait is passed. */ initials?: string; /** A portrait or a Duotone in place of the initials disc. */ avatar?: ReactNode; /** An agent's line takes the phosphor border and its glow. */ agent?: boolean; /** A system notice: centred mono phosphor, no bubble. */ system?: boolean; children: ReactNode; className?: string; } export function ChatLine({ who, initials, avatar, agent = false, system = false, children, className }: ChatLineProps) { const cls = ['ph-line', agent ? 'ph-line--agent' : null, system ? 'ph-line--system' : null, className] .filter(Boolean) .join(' '); if (system) { return (

{children}

); } return (
{avatar ?? ( )}
{who}

{children}

); }