import { createEffect } from "solid-js"; import type { CommentInputBlockProps } from "~/types/comment"; import Button from "~/components/ui/Button"; export default function CommentInputBlock(props: CommentInputBlockProps) { let bodyRef: HTMLTextAreaElement | undefined; createEffect(() => { if (!props.commentSubmitLoading && bodyRef) { bodyRef.value = ""; } }); const newCommentWrapper = (e: SubmitEvent) => { e.preventDefault(); if (bodyRef && bodyRef.value.length > 0) { props.newComment(bodyRef.value, props.parent_id); } }; if (props.isAuthenticated) { return (