import * as React from 'react' import type { ReactNode } from 'react' import type { SAILGridHeight } from '../../types/sail' import { mergeClasses } from '../../utils/classNames' import { ButtonWidget } from '../Button/ButtonWidget' export interface ChatPanelHeaderAction { icon: string label: string onClick?: () => void } export interface ChatPanelProps { /** Title displayed in the header */ title?: string /** Action buttons displayed in the header */ headerActions?: ChatPanelHeaderAction[] /** Content to display in the scrollable area */ children: ReactNode /** Content to display in the footer (typically ChatInput) */ footer?: ReactNode /** Height of the panel */ height?: SAILGridHeight /** Additional Tailwind classes for prototype-specific styling (not part of SAIL API) */ className?: string } export const ChatPanel: React.FC = ({ title, headerActions, children, footer, height = 'AUTO', className, }) => { const heightMap: Record = { SHORT: 'h-40', SHORT_PLUS: 'h-52', MEDIUM: 'h-64', MEDIUM_PLUS: 'h-80', TALL: 'h-96', TALL_PLUS: 'h-[28rem]', EXTRA_TALL: 'h-[36rem]', AUTO: 'h-screen', } const sailClasses = `flex flex-col bg-white ${heightMap[height]}` return (
{(title || headerActions) && (
{title &&

{title}

} {headerActions && headerActions.length > 0 && (
{headerActions.map((action, index) => ( ))}
)}
)}
{children}
{footer && (
{footer}
)}
) }