import { Textarea } from '@/components/ui/textarea'; import { cn } from '@/lib/utils'; import { useState } from 'react'; interface FormatPreserveEditorProps { initialValue: string; onSave: (value: string) => void; className?: string; } const FormatPreserveEditor = ({ initialValue, onSave, className, }: FormatPreserveEditorProps) => { const [content, setContent] = useState(initialValue); const [isEditing, setIsEditing] = useState(false); const handleEdit = () => setIsEditing(true); const handleSave = () => { onSave(content); setIsEditing(false); }; return (
{isEditing ? (