import { useState } from "react"; import { RiReplyFill, RiRobotFill } from "@remixicon/react"; import CommentForm, { type CommentFormSubmitValues } from "../comment-form"; interface CommentItemProps { data: API.Comment.ICommentDetailData; onSubmit: (values: CommentFormSubmitValues) => Promise; } export default function CommentItem({ data, onSubmit }: CommentItemProps) { const [active, setActive] = useState(false); const onToggleCommentForm = () => setActive((prev) => !prev); const onReplySubmit = (values: CommentFormSubmitValues) => { return onSubmit(values).then(() => { setActive(false); }); }; return (
{data.name
{data.name} {data.is_ai_bot && ( )}

{data.content} {data.status === "waiting" && ( (审核中) )}

{active && (
)} {data.children && data.children.length > 0 && (
{data.children.map((item) => ( ))}
)}
); }