feat: retro Claude ekip konsolunu kur
This commit is contained in:
33
web/src/components/ChatStream.jsx
Normal file
33
web/src/components/ChatStream.jsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import PanelFrame from "./PanelFrame.jsx";
|
||||
|
||||
export default function ChatStream({ chat, session }) {
|
||||
const scrollerRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
const node = scrollerRef.current;
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
node.scrollTop = node.scrollHeight;
|
||||
}, [chat]);
|
||||
|
||||
const isEmpty = !chat.trim();
|
||||
|
||||
return (
|
||||
<PanelFrame title="Claude Live Feed" eyebrow="PRIMARY STREAM" className="chat-panel">
|
||||
<div className="chat-stream" ref={scrollerRef}>
|
||||
{isEmpty ? (
|
||||
<div className="empty-state">
|
||||
<span>NO ACTIVE SESSION</span>
|
||||
<span>PRESS START TO BOOT CLAUDE CONSOLE</span>
|
||||
{session.runtime?.anthropicBaseUrl ? <span>ROUTE: {session.runtime.anthropicBaseUrl}</span> : null}
|
||||
</div>
|
||||
) : (
|
||||
<pre>{chat}</pre>
|
||||
)}
|
||||
</div>
|
||||
</PanelFrame>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user