Files
chat-proxy/frontend/src/ChatLayout.jsx
T
2025-08-22 13:50:11 +00:00

42 lines
991 B
React

// src/ChatLayout.jsx
// ChatLayout.jsx
import React from "react";
import ChatHeader from "./ChatHeader";
import ChatWindow from "./ChatWindow";
import ChatInput from "./ChatInput";
export default function ChatLayout({
theme,
messages,
loading,
onSend,
onStop,
onToggleTheme,
onReloadHistory,
onFreshStart
}) {
return (
<div className={`d-flex flex-column vh-100 ${theme.bodyBg}`}>
<ChatHeader
theme={theme}
onToggleTheme={onToggleTheme}
onReloadHistory={onReloadHistory}
onFreshStart={onFreshStart}
/>
<div className="flex-grow-1 overflow-auto">
<ChatWindow messages={messages} loading={loading} theme={theme} />
</div>
{loading && (
<div className="p-2 text-center">
<button className="btn btn-warning btn-sm" onClick={onStop}>
Stop Generating
</button>
</div>
)}
<ChatInput onSend={onSend} loading={loading} />
</div>
);
}