import { ChatDefaultContextManagementPage } from '../ChatDefaultContextManagementPage';
import { ResourceManagementPage } from '../ResourceManagementPage';
import { SharedChatManagementPage } from '../SharedChatManagementPage';
import { ChatTypeManagementPage } from '../ChatTypeManagementPage';
import { MainChatPanel } from '../MainChatPanel';
import { ChatSourceChangesPage } from '../ChatSourceChangesPage';
import { SystemChatPage } from '../SystemChatPage';
import { useMainLayoutContext } from '../layout/MainLayoutContext';

export function ChatPage() {
  const { selectedChatMenu } = useMainLayoutContext();

  return (
    <div className="app-main-panel">
      {selectedChatMenu === 'manage' ? (
        <ChatTypeManagementPage />
      ) : selectedChatMenu === 'manage-defaults' ? (
        <ChatDefaultContextManagementPage />
      ) : selectedChatMenu === 'manage-share' ? (
        <SharedChatManagementPage />
      ) : selectedChatMenu === 'resources' ? (
        <ResourceManagementPage />
      ) : selectedChatMenu === 'system' ? (
        <SystemChatPage />
      ) : selectedChatMenu === 'changes' ? (
        <ChatSourceChangesPage />
      ) : (
        <MainChatPanel initialView={selectedChatMenu} lockOuterScrollOnMobile />
      )}
    </div>
  );
}
