import type { HelpContent } from "./types"; import { reportsHelpContent } from "./reports"; import { dashboardUserHelpContent } from "./dashboard-user"; import { dashboardAdminHelpContent } from "./dashboard-admin"; import { dashboardSupervisorHelpContent } from "./dashboard-supervisor"; import { dashboardStaffHelpContent } from "./dashboard-staff"; import { siteSettingsHelpContent } from "./site-settings"; import { authHelpContent } from "./auth"; import { dashboardUserPaymentsHelpContent } from "./dashboard-user-payments"; import { dashboardUserDonateHelpContent } from "./dashboard-user-donate"; import { generalHelpContent } from "./general"; import { homeHelpContent } from "./home"; import { eventsHelpContent } from "./events"; import { eventDetailHelpContent } from "./event-detail"; import { dashboardAdminUsersHelpContent } from "./dashboard-admin-users"; import { dashboardAdminRegistrationsHelpContent } from "./dashboard-admin-registrations"; import { dashboardAdminCashupHelpContent, dashboardAdminCashupDetailHelpContent } from "./dashboard-admin-cashup"; import { supervisorEventsHelpContent } from "./supervisor-events"; import { supervisorEventOptionsHelpContent } from "./supervisor-event-options"; import { supervisorManualHelpContent, supervisorManualRegistrationLegacyHelpContent } from "./supervisor-manual"; import { supervisorAtTheDoorHelpContent } from "./supervisor-at-the-door"; import { supervisorPaymentsHelpContent } from "./supervisor-payments"; import { supervisorFormsHelpContent } from "./supervisor-forms"; import { supervisorCouponsHelpContent } from "./supervisor-coupons"; import { supervisorBundlesHelpContent } from "./supervisor-bundles"; import { supervisorConsentHelpContent } from "./supervisor-consent"; import { supervisorWaitlistHelpContent } from "./supervisor-waitlist"; import { supervisorAttendanceHelpContent } from "./supervisor-attendance"; import { supervisorOfflineScansHelpContent } from "./supervisor-offline-scans"; import { supervisorAllocationsHelpContent, staffMyGroupsHelpContent } from "./supervisor-allocations"; import { supervisorEmailAttendeesHelpContent } from "./supervisor-email-attendees"; import { supervisorWhatsappAttendeesHelpContent } from "./supervisor-whatsapp-attendees"; import { staffEventTicketsHelpContent } from "./staff-event-tickets"; import { staffTicketScanningHelpContent } from "./staff-ticket-scanning"; import { userFormsHelpContent } from "./user-forms"; type HelpRegistryEntry = { /** Unique, stable identifier for this guide. */ slug: string; matches: (pathname: string) => boolean; content: HelpContent; }; // Most-specific first; the first match wins. Anything that matches nothing // falls back to `generalHelpContent` below. const REGISTRY: HelpRegistryEntry[] = [ { slug: "reports", matches: pathname => pathname === "/dashboard/supervisor/reports", content: reportsHelpContent, }, { slug: "dashboard-user", matches: pathname => pathname === "/dashboard/user", content: dashboardUserHelpContent, }, { slug: "dashboard-admin", matches: pathname => pathname === "/dashboard/admin", content: dashboardAdminHelpContent, }, { slug: "dashboard-supervisor", matches: pathname => pathname === "/dashboard/supervisor", content: dashboardSupervisorHelpContent, }, { slug: "dashboard-staff", matches: pathname => pathname === "/dashboard/staff", content: dashboardStaffHelpContent, }, { slug: "site-settings", matches: pathname => pathname === "/dashboard/admin/settings", content: siteSettingsHelpContent, }, { slug: "dashboard-user-payments", matches: pathname => pathname === "/dashboard/user/payments", content: dashboardUserPaymentsHelpContent, }, { slug: "dashboard-user-donate", matches: pathname => pathname === "/dashboard/user/donate", content: dashboardUserDonateHelpContent, }, { slug: "auth", matches: pathname => pathname === "/login" || pathname === "/register" || pathname === "/forgot-password", content: authHelpContent, }, { slug: "home", matches: pathname => pathname === "/", content: homeHelpContent, }, { slug: "events", matches: pathname => pathname === "/events", content: eventsHelpContent, }, { slug: "event-detail", matches: pathname => /^\/events\/[^/]+$/.test(pathname), content: eventDetailHelpContent, }, { slug: "dashboard-admin-users", matches: pathname => pathname === "/dashboard/admin/users", content: dashboardAdminUsersHelpContent, }, { slug: "dashboard-admin-registrations", matches: pathname => pathname === "/dashboard/admin/registrations", content: dashboardAdminRegistrationsHelpContent, }, { slug: "dashboard-admin-cashup-detail", matches: pathname => /^\/dashboard\/admin\/cashup\/[^/]+$/.test(pathname), content: dashboardAdminCashupDetailHelpContent, }, { slug: "dashboard-admin-cashup", matches: pathname => pathname === "/dashboard/admin/cashup", content: dashboardAdminCashupHelpContent, }, { slug: "supervisor-events", matches: pathname => pathname === "/dashboard/supervisor/events" || pathname === "/dashboard/supervisor/sections", content: supervisorEventsHelpContent, }, { slug: "supervisor-event-options", matches: pathname => pathname === "/dashboard/supervisor/event-options", content: supervisorEventOptionsHelpContent, }, { slug: "supervisor-manual", matches: pathname => pathname === "/dashboard/supervisor/manual", content: supervisorManualHelpContent, }, { slug: "supervisor-manual-registration-legacy", matches: pathname => pathname === "/dashboard/supervisor/manual-registration", content: supervisorManualRegistrationLegacyHelpContent, }, { slug: "supervisor-at-the-door", matches: pathname => pathname === "/dashboard/supervisor/at-the-door", content: supervisorAtTheDoorHelpContent, }, { slug: "supervisor-payments", matches: pathname => pathname === "/dashboard/supervisor/payments", content: supervisorPaymentsHelpContent, }, { slug: "supervisor-allocations", matches: pathname => pathname === "/dashboard/supervisor/allocations", content: supervisorAllocationsHelpContent, }, { slug: "staff-my-groups", matches: pathname => pathname === "/dashboard/staff/my-groups", content: staffMyGroupsHelpContent, }, { slug: "supervisor-offline-scans", matches: pathname => pathname === "/dashboard/supervisor/offline-scans", content: supervisorOfflineScansHelpContent, }, { slug: "supervisor-waitlist", matches: pathname => pathname === "/dashboard/supervisor/waitlist", content: supervisorWaitlistHelpContent, }, { slug: "supervisor-attendance", matches: pathname => pathname === "/dashboard/supervisor/attendance", content: supervisorAttendanceHelpContent, }, { slug: "supervisor-consent", matches: pathname => pathname === "/dashboard/supervisor/consent", content: supervisorConsentHelpContent, }, { slug: "supervisor-coupons", matches: pathname => pathname === "/dashboard/supervisor/coupons", content: supervisorCouponsHelpContent, }, { slug: "supervisor-bundles", matches: pathname => pathname === "/dashboard/supervisor/bundles", content: supervisorBundlesHelpContent, }, { slug: "supervisor-forms", matches: pathname => pathname === "/dashboard/supervisor/forms" || pathname === "/dashboard/admin/forms", content: supervisorFormsHelpContent, }, { slug: "supervisor-email-attendees", matches: pathname => pathname === "/dashboard/supervisor/email-attendees", content: supervisorEmailAttendeesHelpContent, }, { slug: "supervisor-whatsapp-attendees", matches: pathname => pathname === "/dashboard/supervisor/whatsapp-attendees", content: supervisorWhatsappAttendeesHelpContent, }, { slug: "staff-event-tickets", matches: pathname => pathname === "/dashboard/staff/event-tickets", content: staffEventTicketsHelpContent, }, { slug: "staff-ticket-scanning", matches: pathname => pathname === "/dashboard/staff/ticket-scanning", content: staffTicketScanningHelpContent, }, { slug: "user-forms", matches: pathname => pathname === "/dashboard/user/forms", content: userFormsHelpContent, }, ]; export function resolveHelpContent(pathname: string): { slug: string; content: HelpContent } { const match = REGISTRY.find(entry => entry.matches(pathname)); if (match) return { slug: match.slug, content: match.content }; return { slug: "general", content: generalHelpContent }; }