diff --git a/app/w/[id]/components/comment-block/comment-block.tsx b/app/w/[id]/components/comment-block/comment-block.tsx deleted file mode 100644 index b55691103c..0000000000 --- a/app/w/[id]/components/comment-block/comment-block.tsx +++ /dev/null @@ -1,106 +0,0 @@ -import { useState, useEffect, useRef } from 'react' -import { Card } from '@/components/ui/card' -import { Textarea } from '@/components/ui/textarea' -import { X } from 'lucide-react' -import { useCommentStore } from '@/stores/comments/store' -import { NodeProps } from 'reactflow' -import { cn } from '@/lib/utils' - -interface CommentBlockData { - id: string - text: string -} - -export function CommentBlock({ data }: NodeProps) { - const [text, setText] = useState(data.text) - const [isEditing, setIsEditing] = useState(!data.text) - const [isExpanded, setIsExpanded] = useState(false) - const textareaRef = useRef(null) - const { updateComment, removeComment } = useCommentStore() - - useEffect(() => { - if (isEditing && textareaRef.current) { - textareaRef.current.focus() - } - }, [isEditing]) - - const handleBlur = () => { - setIsEditing(false) - setIsExpanded(false) - if (text.trim()) { - updateComment(data.id, text) - } else { - removeComment(data.id) - } - } - - const handleClick = () => { - setIsExpanded(true) - if (!text) { - setIsEditing(true) - } - } - - if (!isExpanded) { - return ( -
setIsExpanded(true)} - > -
-
- ) - } - - return ( - !isEditing && setIsExpanded(false)} - > -
-
Note
- -
- -
setIsEditing(true)}> - {isEditing ? ( -