import { createEffect } from "solid-js"; import type { CommentInputBlockProps } from "~/types/comment"; 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.privilegeLevel === "user" || props.privilegeLevel === "admin") { return (