/* ═══════════════════════════════════════════════════════════════ ADMIN HOME Where login lands. Two columns: the cards are the navigation — the header deliberately drops its tab row here so the same links aren't drawn twice — and a standing info panel on the right. The cards come from adminNav.js, the same list the CMS header reads, so a new entity shows up here the moment it's registered. Forms sit in their own block below: they're submissions coming in rather than content going out, and there'll be more of them than the feedback queue eventually. The Panel block below that only exists for superadmins. The right-hand panel is deliberately inert. Nothing here fetches, so the landing page can't be slow or half-broken on arrival; anything live (open feedback count, last-edited record) wants to be a separate component that fails on its own. ═══════════════════════════════════════════════════════════════ */ import { Link } from "react-router-dom"; import { useAuth } from "../../lib/auth.tsx"; import { SITE_VERSION } from "../../lib/version.ts"; import { ROLE_LABELS, isSuper } from "../../lib/roles.ts"; import { CMS_NAV, FORMS_NAV, PANEL_NAV, target } from "./adminNav.js"; /* One card. The title link is stretched over the whole card with `after:absolute`, which makes the card clickable without nesting an anchor inside an anchor; the sub-links sit above it on z-10 so they stay separately clickable. */ function NavCard({ item }) { const to = target(item); // Drop the child that just repeats the card's own destination — // "All organizations" under Organizations. const extras = (item.children ?? []).filter((child) => child.to !== to); return (
{item.blurb}
)} {extras.length > 0 && ({blurb}
}Pick a section to work in.