'use client';

import React from 'react';

import type { ChatMessage, ProcessArtifact, ProcessEvent, ProcessRun } from '@/types';
import { MessageList } from '@/components/chat-workbench/MessageList';

export function ChatWorkbench({
  messages,
  isThinking,
  messagesEndRef,
  messageViewportRef,
  processRuns,
  processEvents,
  processArtifacts,
  selectedRunId,
  onSelectRun,
  onFeedback,
}: {
  messages: ChatMessage[];
  isThinking: boolean;
  messagesEndRef: React.RefObject<HTMLDivElement>;
  messageViewportRef: React.RefObject<HTMLDivElement>;
  processRuns: ProcessRun[];
  processEvents: ProcessEvent[];
  processArtifacts: ProcessArtifact[];
  selectedRunId: string | null;
  onSelectRun: (runId: string) => void;
  onFeedback: (runId: string, feedbackType: 'satisfied' | 'revise' | 'abandon', comment?: string) => void;
}) {
  return (
    <div className="h-full">
    <MessageList
      messages={messages}
      isThinking={isThinking}
      messagesEndRef={messagesEndRef}
      viewportRef={messageViewportRef}
      processRuns={processRuns}
      processEvents={processEvents}
      processArtifacts={processArtifacts}
      selectedRunId={selectedRunId}
      onSelectRun={onSelectRun}
      onFeedback={onFeedback}
    />
    </div>
  );
}
