Implement chat panels

This commit is contained in:
2025-09-05 22:36:24 +03:00
Unverified
parent 04d3e4d995
commit cad42e1584
11 changed files with 775 additions and 55 deletions
@@ -1,14 +1,22 @@
import { useState } from "react";
import { useChat } from "../../hooks/useChat";
export function ChatInputWrapper() {
interface ChatInputWrapperProps {
onSendMessage?: (message: string) => void;
}
export function ChatInputWrapper({ onSendMessage }: ChatInputWrapperProps) {
const [message, setMessage] = useState("");
const { sendMessage } = useChat();
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (message.trim()) {
await sendMessage(message);
if (onSendMessage) {
onSendMessage(message);
} else {
await sendMessage(message);
}
setMessage("");
}
};