Halte Anlagen und Versand als eigene Verwendung fest, damit die uebermittelte Fassung und ihre Nachweise spaeter nicht still mit der Arbeitsfassung verschmelzen.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f21c64a944
commit
3c190c87b4
27 files changed
+3953
-71
No files matched your search
@@ -72,6 +72,23 @@ export function trailWithChapter(items, chapters, chapterId, backHref) {
|
||||
return [...base, { label: path.join(" / "), href: null }];
|
||||
}
|
||||
|
||||
export function countLabel(direct, nested) {
|
||||
const here = Number(direct) || 0;
|
||||
const below = Number(nested) || 0;
|
||||
if (here && below) return `${here} direkt · ${below} in Unterkapiteln`;
|
||||
if (!here && below) return `${below} in Unterkapiteln`;
|
||||
return String(here);
|
||||
}
|
||||
|
||||
export function sectionCounts(section) {
|
||||
const direct = (section?.items || []).length;
|
||||
const nested = (section?.children || []).reduce((sum, child) => {
|
||||
const inner = sectionCounts(child);
|
||||
return sum + inner.direct + inner.nested;
|
||||
}, 0);
|
||||
return { direct, nested };
|
||||
}
|
||||
|
||||
export function findSection(nodes, id) {
|
||||
for (const node of nodes || []) {
|
||||
if (node.id === id) return node;
|
||||
|
||||
Reference in new issue
Block a user