new admin ui

This commit is contained in:
2025-12-30 17:22:02 -05:00
parent 85d4629d3c
commit 228d08337f
4 changed files with 430 additions and 95 deletions
+48 -17
View File
@@ -3,7 +3,9 @@
import type React from "react";
import { useEffect, useMemo, useState } from "react";
import { usePathname, useRouter } from "next/navigation";
import AdminLeftNavigation from "@/components/AdminLeftNavigation";
import AdminLeftNavigation, {
type AdminNavGroup,
} from "@/components/AdminLeftNavigation";
import { useAuth } from "@/context/AuthContext";
import {
LayoutDashboard,
@@ -13,24 +15,53 @@ import {
Store,
Users,
Settings,
LucideMail,
Mail,
Wand2,
FolderKanban,
Shield,
} from "lucide-react";
const navItems = [
{ label: "Dashboard", href: "/admin", icon: <LayoutDashboard className="h-4 w-4" /> },
{ label: "Imports", href: "/admin/import-status", icon: <Download className="h-4 w-4" /> },
{ label: "Mappings", href: "/admin/mapping", icon: <Layers className="h-4 w-4" /> },
{ label: "Products", href: "/admin/products", icon: <Boxes className="h-4 w-4" /> },
{ label: "Merchants", href: "/admin/merchants", icon: <Store className="h-4 w-4" /> },
{ label: "Platforms", href: "/admin/platforms", icon: <Layers className="h-4 w-4" /> },
{ label: "Enrichment", href: "/admin/enrichment", icon: <Wand2 className="h-4 w-4" /> },
{ label: "Users", href: "/admin/users", icon: <Users className="h-4 w-4" /> },
{ label: "Settings", href: "/admin/settings", icon: <Settings className="h-4 w-4" /> },
{ label: "List Emails", href: "/admin/email", icon: <LucideMail className="h-4 w-4" /> },
{ label: "Send an Email", href: "/admin/email/send", icon: <LucideMail className="h-4 w-4" /> },
{ label: "Beta Invites", href: "/admin/beta-invites", icon: <LucideMail className="h-4 w-4" /> },
const navGroups: AdminNavGroup[] = [
{
label: "Overview",
icon: <LayoutDashboard className="h-4 w-4" />,
items: [{ label: "Dashboard", href: "/admin", icon: <LayoutDashboard className="h-4 w-4" /> }],
},
{
label: "Catalog",
icon: <FolderKanban className="h-4 w-4" />,
items: [
{ label: "Products", href: "/admin/products", icon: <Boxes className="h-4 w-4" /> },
{ label: "Platforms", href: "/admin/platforms", icon: <Layers className="h-4 w-4" /> },
],
},
{
label: "Data Ops",
icon: <Download className="h-4 w-4" />,
items: [
{ label: "Imports", href: "/admin/import-status", icon: <Download className="h-4 w-4" /> },
{ label: "Mappings", href: "/admin/mapping", icon: <Layers className="h-4 w-4" /> },
{ label: "Enrichment", href: "/admin/enrichment", icon: <Wand2 className="h-4 w-4" /> },
],
},
{
label: "Growth & Comms",
icon: <Mail className="h-4 w-4" />,
items: [
{ label: "Beta Invites", href: "/admin/beta-invites", icon: <Mail className="h-4 w-4" /> },
{ label: "List Emails", href: "/admin/email", icon: <Mail className="h-4 w-4" /> },
{ label: "Send an Email", href: "/admin/email/send", icon: <Mail className="h-4 w-4" /> },
],
},
{
label: "Access & Config",
icon: <Shield className="h-4 w-4" />,
items: [
{ label: "Users", href: "/admin/users", icon: <Users className="h-4 w-4" /> },
{ label: "Merchants", href: "/admin/merchants", icon: <Store className="h-4 w-4" /> },
{ label: "Settings", href: "/admin/settings", icon: <Settings className="h-4 w-4" /> },
],
},
];
export default function AdminLayout({
@@ -79,7 +110,7 @@ export default function AdminLayout({
<AdminLeftNavigation
collapsed={collapsed}
onToggleCollapsed={() => setCollapsed((v) => !v)}
items={navItems}
groups={navGroups}
/>
{/* Main column */}