From 92d7df2a386d703c415584c9c212e08b4944eb3d Mon Sep 17 00:00:00 2001 From: "M. Pabiszczak" <2+mpabi@noreply.zsl-gitea.mpabi.pl> Date: Sun, 19 Jul 2026 17:41:30 +0200 Subject: [PATCH] feat: standardize card library as treegrid widget --- react/src/main.tsx | 369 ++++++++++++++++++++++++++++---------------- react/src/react.css | 172 +++++++++++++++++++++ web/app.css | 2 +- web/app.js | 18 +-- 4 files changed, 421 insertions(+), 140 deletions(-) diff --git a/react/src/main.tsx b/react/src/main.tsx index 01908c8..a6a99b3 100644 --- a/react/src/main.tsx +++ b/react/src/main.tsx @@ -4594,6 +4594,87 @@ function SidePanelDock({ ); } +type CardLibraryTreeKind = "subject" | "level" | "series" | "card" | "task"; + +function CardLibraryTreeRow({ + id, + depth, + kind, + title, + label, + refValue, + stateValue, + stateKind, + hasChildren = false, + expanded = false, + onToggle, + href, + current = false, + unavailable = false, + onNavigate, +}: { + id: string; + depth: number; + kind: CardLibraryTreeKind; + title: string; + label: React.ReactNode; + refValue: React.ReactNode; + stateValue: React.ReactNode; + stateKind?: string; + hasChildren?: boolean; + expanded?: boolean; + onToggle?: () => void; + href?: string; + current?: boolean; + unavailable?: boolean; + onNavigate?: () => void; +}) { + const nodeLabel = href ? ( + + {label} + + ) : ( + {label} + ); + return ( +
{seriesCount} serii · {availableCount}/{cardCount} kart online
+