import { useEffect, useRef, useState } from "react"; import { api, downloadPost } from "../api.js"; import { symbolUrl } from "../content-symbol.mjs"; function leafIds(node, into = []) { if (!node) return into; if (node.kind === "binding" || node.kind === "annotation" || node.kind === "attachment" || node.kind === "dispatch_item" || node.kind === "evidence") into.push(node.id); (node.children || []).forEach((child) => leafIds(child, into)); return into; } function checkState(node, selected) { const ids = leafIds(node); if (!ids.length) return "off"; const count = ids.filter((id) => selected.has(id)).length; if (count === 0) return "off"; if (count === ids.length) return "on"; return "mixed"; } function withNode(node, selected, on) { const next = new Set(selected); leafIds(node).forEach((id) => { if (on) next.add(id); else next.delete(id); }); return next; } function initialSelection(node) { const next = new Set(); function visit(current) { if ((current.kind === "binding" || current.kind === "annotation" || current.kind === "attachment" || current.kind === "dispatch_item" || current.kind === "evidence") && current.exportable) { next.add(current.id); } (current.children || []).forEach(visit); } visit(node); return next; } function CheckBox({ state, disabled, onChange, label }) { const ref = useRef(null); useEffect(() => { if (ref.current) ref.current.indeterminate = state === "mixed"; }, [state]); return ( ); } function ContentMark({ name }) { return ( ); } function symbolFor(node) { if (node.kind === "chapter") return "chapter"; if (node.kind === "matter") return node.label === "Teilvorgang" ? "submatter" : "matter"; if (node.kind === "annotation" || node.content_kind === "note") return "note"; if (node.content_kind === "email") return "email"; if (node.content_kind === "paperless") return "source-archive"; if (node.content_kind === "url") return "link"; return "file"; } function TreeBranch({ node, selected, onToggle }) { const state = checkState(node, selected); const ids = leafIds(node); const branch = node.kind === "matter" || node.kind === "chapter"; return (
Die Auswahl gilt für diese Ausgabe. Ein bereits heruntergeladenes Paket verändert sich nicht, wenn danach Inhalte geändert oder ergänzt werden.
{error ?{error}
: null} {!tree ?Auswahl wird geladen …
: null} {tree && !review ? ( <>{issue.title}: {issue.message}
)) :Die Auswahl ist vollständig und kann ausgegeben werden.
} {review.notices?.map((notice) => ({notice.message}
))} {ambiguous.map((issue) => ( ))}Das Paket wurde heruntergeladen. Es hält den Stand dieses Zeitpunkts fest.
) : null}