Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | 1x 1x 1x 1x 1x 1x 1x 31x 31x 186x 186x 713x 713x 186x 31x 31x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import { Menu } from "@/types/Menu";
import { adminDashboardConfig } from "./adminDashboard";
/**
* Convert adminDashboardConfig sections to menu format
* This ensures the admin dropdown menu stays in sync with the admin dashboard
*/
function buildAdminSectionsFromDashboard(): Menu[] {
return adminDashboardConfig.map((section) => ({
title: section.title,
submenu: section.items.map((item) => ({
title: item.title,
path: item.href,
})),
}));
}
// Menu data for the admin dropdown in the header
// Note: Popular, Shop, Contact links have been removed as part of header simplification
// - Popular: Users can click logo to go home
// - Shop: Users use search bar to find products
// - Contact: Available in footer
export const menuData: Menu[] = [
{
title: "Admin",
adminOnly: true,
submenu: [
{ title: "Dashboard", path: "/admin" },
// Dynamic sections from adminDashboardConfig - these stay in sync with the dashboard
...buildAdminSectionsFromDashboard(),
// Static sections below (not shown on dashboard)
{
title: "Users",
submenu: [
{ title: "All Users", path: "/admin/users" },
{ title: "Roles & Permissions", path: "/admin/users/roles" },
],
},
{
title: "Settings",
submenu: [
{ title: "General", path: "/admin/settings/general" },
{ title: "Payments", path: "/admin/settings/payments" },
{ title: "Shipping", path: "/admin/settings/shipping" },
{ title: "Notifications", path: "/admin/settings/notifications" },
],
},
{
title: "Reports",
submenu: [
{ title: "Sales", path: "/admin/reports/sales" },
{ title: "Inventory", path: "/admin/reports/inventory" },
{ title: "Customers", path: "/admin/reports/customers" },
],
},
{
title: "Pages",
submenu: [
{ title: "Shop", path: "/shop" },
{ title: "Products", path: "/products" },
{ title: "Checkout", path: "/checkout" },
{ title: "Cart", path: "/cart" },
{ title: "Wishlist", path: "/wishlist" },
{ title: "Sign in", path: "/signin" },
{ title: "Sign up", path: "/signup" },
{ title: "My Account", path: "/my-account" },
{ title: "Contact", path: "/contact" },
{ title: "Error", path: "/error" },
{ title: "Mail Success", path: "/mail-success" },
],
},
],
},
];
|