{adminActive && (
)}
מערכת
{ADMIN_ITEMS.map((item) => {
const active = isActive(pathname, item.href);
return (
{item.label}
);
})}
{children}
>
);
}
function NavLink({ item, active }: { item: NavItem; active: boolean }) {
return (
{item.label}
{item.href === "/approvals" ? : null}
{active && (
)}
);
}
/* Knowledge-cluster dropdown (פסיקה / סגנון). The trigger mirrors the admin
* dropdown styling and lights up — gold underline included — when any child
* route is active, so the active section reads even while the menu is closed.
* The "פסיקה חסרה" open-count badge surfaces on the trigger too, so the
* pending count stays visible without opening the menu. */
function NavMenu({ menu, pathname }: { menu: NavMenuDef; pathname: string }) {
const menuActive = menu.items.some((i) => isActive(pathname, i.href));
const hasMissingPrecedents = menu.items.some((i) => i.href === "/missing-precedents");
return (
{menu.label}
{hasMissingPrecedents ? : null}
{menuActive && (
)}
{menu.items.map((item) => {
const active = isActive(pathname, item.href);
return (
{item.groupLabel && (
<>
{item.groupLabel}
>
)}
{item.label}
{item.href === "/missing-precedents" ? : null}
);
})}
);
}
/* Total pending-approvals badge next to "מרכז אישורים" — Dafna's outstanding
* human-gate items (halachot + missing precedents + feedback + qa_failed).
* Renders only when >0 so the nav stays quiet when everything is cleared. */
function ApprovalsBadge() {
const { data } = usePendingApprovals();
const total = data?.total_pending ?? 0;
if (!total) return null;
return (
{total}
);
}
/* Small open-count badge next to "פסיקה חסרה" — only renders when >0
* so the nav stays quiet in normal operation. */
function MissingPrecedentsBadge() {
const { data: openCount } = useMissingPrecedentsOpenCount();
if (!openCount) return null;
return (
{openCount}
);
}