mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Remove unused code
This commit is contained in:
@@ -1,23 +1,17 @@
|
||||
import { useState } from "react";
|
||||
import { useChat } from "../../hooks/useChat";
|
||||
import { RichTextArea } from "../core/RichTextArea";
|
||||
|
||||
interface ChatInputWrapperProps {
|
||||
onSendMessage?: (message: string) => void;
|
||||
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()) {
|
||||
if (onSendMessage) {
|
||||
onSendMessage(message);
|
||||
} else {
|
||||
await sendMessage(message);
|
||||
}
|
||||
onSendMessage(message);
|
||||
setMessage("");
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user