'use client'
import { useState } from 'react'
export function ApiGdprProcessEditor({
process,
saving,
onSave,
}: {
process: { id: string; process_key: string; title: string; description: string; legal_basis: string; retention_days: number; is_active: boolean }
saving: boolean
onSave: (title: string, description: string) => void
}) {
const [title, setTitle] = useState(process.title)
const [description, setDescription] = useState(process.description || '')
const [expanded, setExpanded] = useState(false)
return (
{process.legal_basis?.replace('Art. ', '').replace(' DSGVO', '') || '?'}
{title}
{description || 'Keine Beschreibung'}
{process.retention_days && (
Aufbewahrung: {process.retention_days} Tage
)}
{expanded && (
setTitle(e.target.value)}
className="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm"
/>
)}
)
}