mirror of
https://github.com/LucasVbr/meeting-app.git
synced 2026-05-13 17:21:53 +00:00
Remove unused imports from FormMessage.tsx
Took 1 minute
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
import {Button, Flex, Input} from '@chakra-ui/react';
|
import {Button, Flex, Input} from '@chakra-ui/react';
|
||||||
import {useState} from 'react';
|
import {useState} from 'react';
|
||||||
import {User} from '@prisma/client';
|
import {User} from '@prisma/client';
|
||||||
import {io, Socket} from 'socket.io-client';
|
|
||||||
import Message from '@/components/chat/Message';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
user: User,
|
user: User,
|
||||||
@@ -15,19 +13,7 @@ export default function FormMessage(props: Props) {
|
|||||||
const [text, setText] = useState("");
|
const [text, setText] = useState("");
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
if (text !== "") {
|
if (text) socket.emit("createdMessage", {text, sender: user.id})
|
||||||
socket.emit("createdMessage", {text, sender: user.id})
|
|
||||||
|
|
||||||
// fetch("/api/messages", {
|
|
||||||
// method: "POST",
|
|
||||||
// headers: {'Content-Type': 'application/json'},
|
|
||||||
// body: JSON.stringify({
|
|
||||||
// text,
|
|
||||||
// 'User': {"connect": {'id': user.id}},
|
|
||||||
// 'Chat': {"connect": {'id': chatId}}
|
|
||||||
// })
|
|
||||||
// }).then(res => res.json()).then(res => console.log(res)).catch(err => console.error(err))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user