"use client"; import Link from "next/link"; import { useEffect, useRef } from "react"; /** * "More" sheet shown when the user taps the "More" tab in the mobile * bottom tab bar (src/components/admin/MobileTabBar.tsx). * * NOTE: The primary navigation tabs (Orders / Stops / Products / Dashboard) * live in the bottom tab bar itself, NOT in this sheet. This sheet * intentionally exposes only the secondary operations so the tab bar can * stay focused on the high-frequency workflows. If you need to add a * primary tab here, do it in MobileTabBar instead. * * (PR 6 cutover: the v1 /admin/orders, /admin/stops, /admin/products * paths now 307-redirect to /admin/v2/* via next.config.ts — see * `redirects()` there.) */ const MORE_SECTIONS = [ { heading: "Operations", links: [ { label: "Pickup", href: "/admin/pickup", icon: "📦" }, { label: "Shipping", href: "/admin/shipping", icon: "🚚" }, { label: "Reports", href: "/admin/reports", icon: "📊" }, { label: "Analytics", href: "/admin/analytics", icon: "📈" }, ], }, { heading: "Marketing", links: [ { label: "Communications", href: "/admin/communications", icon: "📧" }, { label: "Sales", href: "/admin/sales", icon: "💵" }, ], }, { heading: "Settings", links: [ { label: "Settings", href: "/admin/settings", icon: "⚙️" }, { label: "Advanced", href: "/admin/advanced", icon: "🛠" }, ], }, ]; interface MoreSheetProps { open: boolean; onClose: () => void; } export function MoreSheet({ open, onClose }: MoreSheetProps) { const dialogRef = useRef(null); const lastFocusedRef = useRef(null); useEffect(() => { const dialog = dialogRef.current; if (!dialog) return; if (open) { lastFocusedRef.current = document.activeElement as HTMLElement | null; if (!dialog.open) dialog.showModal(); } else if (dialog.open) { dialog.close(); lastFocusedRef.current?.focus(); } }, [open]); useEffect(() => { const dialog = dialogRef.current; if (!dialog) return; const onCancel = (e: Event) => { e.preventDefault(); onClose(); }; dialog.addEventListener("cancel", onCancel); return () => dialog.removeEventListener("cancel", onCancel); }, [onClose]); return (

More

{MORE_SECTIONS.map((section) => (

{section.heading.toUpperCase()}

    {section.links.map((link) => (
  • {link.label}
  • ))}
))}
); } export default MoreSheet;