diff --git a/web/components/comment-box.tsx b/web/components/comment-box.tsx new file mode 100644 index 00000000..12e35f07 --- /dev/null +++ b/web/components/comment-box.tsx @@ -0,0 +1,31 @@ +import { useState } from 'react' +import { createComment } from '../lib/firebase/comments' +import { User } from '../lib/firebase/users' + +export function CommentBox(props: { + className?: string + contractId: string + betId: string + user: User | null | undefined +}) { + const { className, contractId, betId, user } = props + const [comment, setComment] = useState('') + async function submitComment() { + if (!user || !comment) return + await createComment(contractId, betId, comment, user) + } + + return ( +