'use client'
import { useState } from 'react'
import {
X,
History,
Shield,
AlertTriangle,
Monitor,
Globe,
Calendar,
User,
} from 'lucide-react'
import {
ConsentRecord,
typeColors,
typeLabels,
statusColors,
statusLabels,
actionLabels,
actionIcons,
formatDateTime,
} from '../_types'
interface ConsentDetailModalProps {
record: ConsentRecord
onClose: () => void
onRevoke: (recordId: string) => void
}
export function ConsentDetailModal({ record, onClose, onRevoke }: ConsentDetailModalProps) {
const [showRevokeConfirm, setShowRevokeConfirm] = useState(false)
return (
{/* Header */}
Consent-Details
{record.email}
{/* Content */}
{/* User Info */}
Benutzerinformationen
Name:
{record.firstName} {record.lastName}
E-Mail:
{record.email}
User-ID:
{record.identifier}
Consent-Status
Typ:
{typeLabels[record.consentType]}
Status:
{statusLabels[record.status]}
Version:
v{record.currentVersion}
{/* Technical Details */}
Technische Details (letzter Consent)
IP-Adresse
{record.ipAddress}
Quelle
{record.source ?? '—'}
User-Agent
{record.userAgent}
{/* History Timeline */}
Consent-Historie
{record.history.length} Einträge
{/* Timeline line */}
{record.history.map((entry) => (
{/* Icon */}
{actionIcons[entry.action]}
{/* Content */}
{actionLabels[entry.action]}
{entry.documentTitle && (
{entry.documentTitle}
)}
{formatDateTime(entry.timestamp)}
{entry.ipAddress}
Quelle: {entry.source}
{entry.notes && (
{entry.notes}
)}
{/* Expandable User-Agent */}
User-Agent anzeigen
{entry.userAgent}
))}
{/* Footer Actions */}
Consent-ID: {record.id}
{record.status === 'granted' && !showRevokeConfirm && (
)}
{showRevokeConfirm && (
Wirklich widerrufen?
)}
)
}