'use client' import { useState, useTransition } from 'react' import { exportText } from '@/lib/i18n/export' import { commonText } from '@/lib/i18n/common' import { approveExportAction, rejectExportAction } from './actions' type Auftrag = { id: string kind: string label: string requestedBy: string clearanceAtTime: number createdAt: string } /** * Offene Exportfreigaben. * * Vier-Augen-Prinzip: hier steht nur, was **jemand anderes** angefragt hat. * Die eigene Anfrage taucht gar nicht erst auf, und der Dienst weist sie auch * dann zurück, wenn jemand die Kennung von Hand einsetzt. */ export function Approvals({ jobs }: { jobs: Auftrag[] }) { const [ablehnung, setAblehnung] = useState(null) const [grund, setGrund] = useState('') const [fehler, setFehler] = useState(null) const [pending, startTransition] = useTransition() if (jobs.length === 0) { return

{exportText.approvalsEmpty}

} return (
    {jobs.map((auftrag) => (
  • {exportText.kinds[auftrag.kind] ?? auftrag.kind} {auftrag.label} {exportText.requestedBy} {auftrag.requestedBy}
    {ablehnung === auftrag.id ? (