feat: implement chat page with conversation list, message view, and polling
This commit is contained in:
@@ -1,3 +1,32 @@
|
||||
import { useState } from "react";
|
||||
import { useParams } from "react-router-dom";
|
||||
import ConversationList from "../components/ConversationList";
|
||||
import MessageList from "../components/MessageList";
|
||||
import MessageInput from "../components/MessageInput";
|
||||
|
||||
export default function ChatPage() {
|
||||
return <div>Chat</div>;
|
||||
const { workspaceId } = useParams<{ workspaceId: string }>();
|
||||
const [conversationId, setConversationId] = useState<string | null>(null);
|
||||
|
||||
return (
|
||||
<div style={{ display: "flex", height: "100vh" }}>
|
||||
<ConversationList
|
||||
workspaceId={workspaceId!}
|
||||
onSelect={setConversationId}
|
||||
selectedId={conversationId}
|
||||
/>
|
||||
<div style={{ flex: 1, display: "flex", flexDirection: "column" }}>
|
||||
{conversationId ? (
|
||||
<>
|
||||
<MessageList conversationId={conversationId} />
|
||||
<MessageInput conversationId={conversationId} />
|
||||
</>
|
||||
) : (
|
||||
<div style={{ flex: 1, display: "flex", alignItems: "center", justifyContent: "center", color: "#888" }}>
|
||||
Select a conversation
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user