'use client' import { useState, useEffect, useRef } from 'react' interface GutachtenEditorProps { value: string onChange: (value: string) => void onGenerate?: () => void isGenerating?: boolean placeholder?: string className?: string } export function GutachtenEditor({ value, onChange, onGenerate, isGenerating = false, placeholder = 'Gutachten hier eingeben oder generieren lassen...', className = '', }: GutachtenEditorProps) { const [isFocused, setIsFocused] = useState(false) const textareaRef = useRef(null) // Auto-resize textarea useEffect(() => { const textarea = textareaRef.current if (textarea) { textarea.style.height = 'auto' textarea.style.height = `${Math.max(200, textarea.scrollHeight)}px` } }, [value]) // Word count const wordCount = value.trim() ? value.trim().split(/\s+/).length : 0 const charCount = value.length return (
{/* Header */}

Gutachten

{wordCount} Woerter / {charCount} Zeichen {onGenerate && ( )}
{/* Editor */}