{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 === "/missing-precedents" ? : null}
{item.href === "/approvals" ? : null}
{active && (
)}
);
}
/* 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}
);
}