import { Hammer } from 'lucide-react'; import { Loader } from '@/components/ui/loader.tsx'; import MarkdownRenderer from '@/components/ui/markdown-renderer.tsx'; import type { ExecutionProcess, WorktreeDiff } from 'shared/types.ts'; import DisplayConversationEntry from '@/components/tasks/TaskDetails/DisplayConversationEntry.tsx'; import useNormalizedConversation from '@/hooks/useNormalizedConversation'; interface NormalizedConversationViewerProps { executionProcess: ExecutionProcess; onConversationUpdate?: () => void; diff?: WorktreeDiff | null; isBackgroundRefreshing?: boolean; diffDeletable?: boolean; } export function NormalizedConversationViewer({ executionProcess, diffDeletable, onConversationUpdate, }: NormalizedConversationViewerProps) { const { loading, error, conversation, displayEntries } = useNormalizedConversation({ executionProcess, onConversationUpdate, }); if (loading) { return ( ); } if (error) { return
{error}
; } if (!conversation || conversation.entries.length === 0) { // If the execution process is still running, show loading instead of "no data" if (executionProcess.status === 'running') { return (
Waiting for logs...
); } return (
No conversation data available
); } return (
{/* Display prompt if available */} {conversation.prompt && (
)} {/* Display conversation entries */}
{displayEntries.map((entry, index) => ( ))}
); }