diff --git a/components/ui/dialogue-item.tsx b/components/ui/dialogue-item.tsx deleted file mode 100644 index ad36e00..0000000 --- a/components/ui/dialogue-item.tsx +++ /dev/null @@ -1,167 +0,0 @@ -import React, { useState } from 'react'; -import { useSortable } from '@dnd-kit/sortable'; -import { CSS } from '@dnd-kit/utilities'; -import { motion } from 'framer-motion'; -import { GripVertical, Trash2, Edit2, ChevronDown } from 'lucide-react'; -import { DialogueItem as DialogueItemType, CharacterOption } from '@/app/model/enums'; -import KeywordText from './keyword-text'; -import * as Popover from '@radix-ui/react-popover'; -import { mockCharacterOptions } from '@/app/model/enums'; -import './style/dialogue-item.css'; - -interface DialogueItemProps { - dialogue: DialogueItemType; - onUpdate: (updates: Partial) => void; - onDelete: () => void; - onCharacterChange?: (character: CharacterOption) => void; -} - -const DialogueItem: React.FC = ({ - dialogue, - onUpdate, - onDelete, - onCharacterChange, -}) => { - const [isEditing, setIsEditing] = useState(false); - const [editText, setEditText] = useState(dialogue.text); - const [isCharacterSelectOpen, setIsCharacterSelectOpen] = useState(false); - - const { - attributes, - listeners, - setNodeRef, - transform, - transition, - isDragging, - } = useSortable({ id: dialogue.id }); - - const style = { - transform: CSS.Transform.toString(transform), - transition, - }; - - const handleSave = () => { - onUpdate({ text: editText }); - setIsEditing(false); - }; - - const handleCharacterSelect = (character: CharacterOption) => { - onUpdate({ speaker: character.name }); - onCharacterChange?.(character); - setIsCharacterSelectOpen(false); - }; - - return ( - - {/* Drag Handle */} -
- -
- - {/* Content */} -
- {/* Character Selector */} - - - - - - -
- {mockCharacterOptions.map((char) => ( - - ))} -
- -
- - - - - {isEditing ? ( -
-