import React from 'react'; import { CollapsibleSection } from './CollapsibleSection'; type ContentType = 'diff' | 'markdown' | 'file-list' | 'todo-list' | 'text' | 'task' | 'success-message'; interface CollapsibleDisplayProps { toolName: string; toolId?: string; title: string; defaultOpen?: boolean; action?: React.ReactNode; onTitleClick?: () => void; contentType: ContentType; contentProps: any; showRawParameters?: boolean; rawContent?: string; className?: string; onShowSettings?: () => void; toolCategory?: string; } const borderColorMap: Record = { edit: 'border-l-amber-500 dark:border-l-amber-400', search: 'border-l-gray-400 dark:border-l-gray-500', bash: 'border-l-green-500 dark:border-l-green-400', todo: 'border-l-violet-500 dark:border-l-violet-400', task: 'border-l-violet-500 dark:border-l-violet-400', plan: 'border-l-indigo-500 dark:border-l-indigo-400', default: 'border-l-gray-300 dark:border-l-gray-600', }; export const CollapsibleDisplay: React.FC = ({ toolName, title, defaultOpen = false, action, onTitleClick, contentType, contentProps, showRawParameters = false, rawContent, className = '', toolCategory }) => { const renderContent = () => { switch (contentType) { case 'diff': return contentProps.DiffViewer; case 'markdown': return contentProps.MarkdownComponent; case 'file-list': return contentProps.FileListComponent; case 'todo-list': return contentProps.TodoListComponent; case 'task': return contentProps.TaskComponent; case 'text': return contentProps.TextComponent; default: return
Unknown content type: {contentType}
; } }; const borderColor = borderColorMap[toolCategory || 'default']; return (
{renderContent()} {showRawParameters && rawContent && (
raw params
              {rawContent}
            
)}
); };