import React from 'react' import { Box, Text } from 'ink' import { theme, PANEL_WIDTH } from './theme.js' type SurfaceTone = 'primary' | 'muted' | 'error' type SurfaceProps = { title: string subtitle?: React.ReactNode footer?: React.ReactNode tone?: SurfaceTone children?: React.ReactNode } const toneColor: Record = { primary: theme.accentWhite, muted: theme.dim, error: theme.accentError, } export const Surface: React.FC = ({ title, subtitle, footer, tone = 'primary', children, }) => { const titleColor = toneColor[tone] return ( {title} {subtitle ? ( typeof subtitle === 'string' ? {subtitle} : subtitle ) : null} {children ? {children} : null} {footer ? ( {typeof footer === 'string' ? {footer} : footer} ) : null} ) }