diff --git a/client/src/components/AppShell.tsx b/client/src/components/AppShell.tsx index 97e5112..f771a2a 100644 --- a/client/src/components/AppShell.tsx +++ b/client/src/components/AppShell.tsx @@ -1,22 +1,161 @@ import { NavLink, Outlet } from "react-router-dom"; +import type { ReactNode } from "react"; import { useAuth } from "../auth/AuthProvider"; import { ThemeToggle } from "./ThemeToggle"; const links = [ - { to: "/", label: "Dashboard" }, - { to: "/settings/company", label: "Company Settings" }, - { to: "/crm/customers", label: "Customers" }, - { to: "/crm/vendors", label: "Vendors" }, - { to: "/inventory/items", label: "Inventory" }, - { to: "/inventory/warehouses", label: "Warehouses" }, - { to: "/sales/quotes", label: "Quotes" }, - { to: "/sales/orders", label: "Sales Orders" }, - { to: "/purchasing/orders", label: "Purchase Orders" }, - { to: "/shipping/shipments", label: "Shipments" }, - { to: "/planning/gantt", label: "Gantt" }, + { to: "/", label: "Dashboard", icon: }, + { to: "/settings/company", label: "Company Settings", icon: }, + { to: "/crm/customers", label: "Customers", icon: }, + { to: "/crm/vendors", label: "Vendors", icon: }, + { to: "/inventory/items", label: "Inventory", icon: }, + { to: "/inventory/warehouses", label: "Warehouses", icon: }, + { to: "/sales/quotes", label: "Quotes", icon: }, + { to: "/sales/orders", label: "Sales Orders", icon: }, + { to: "/purchasing/orders", label: "Purchase Orders", icon: }, + { to: "/shipping/shipments", label: "Shipments", icon: }, + { to: "/planning/gantt", label: "Gantt", icon: }, ]; +function NavIcon({ children }: { children: ReactNode }) { + return ( + + + {children} + + + ); +} + +function DashboardIcon() { + return ( + + + + + + + ); +} + +function CompanyIcon() { + return ( + + + + + + + + ); +} + +function CustomersIcon() { + return ( + + + + + + + ); +} + +function VendorsIcon() { + return ( + + + + + + + + + + + ); +} + +function InventoryIcon() { + return ( + + + + + + ); +} + +function WarehouseIcon() { + return ( + + + + + + ); +} + +function QuoteIcon() { + return ( + + + + + + + + ); +} + +function SalesOrderIcon() { + return ( + + + + + + + + ); +} + +function PurchaseOrderIcon() { + return ( + + + + + + + + ); +} + +function ShipmentIcon() { + return ( + + + + + + + ); +} + +function GanttIcon() { + return ( + + + + + + + + ); +} + export function AppShell() { const { user, logout } = useAuth(); @@ -35,11 +174,12 @@ export function AppShell() { key={link.to} to={link.to} className={({ isActive }) => - `block rounded-2xl px-2 py-2 text-sm font-semibold transition ${ + `flex items-center gap-2 rounded-2xl px-2 py-2 text-sm font-semibold transition ${ isActive ? "bg-brand text-white" : "text-text hover:bg-page" }` } > + {link.icon} {link.label} ))} @@ -70,11 +210,12 @@ export function AppShell() { key={link.to} to={link.to} className={({ isActive }) => - `whitespace-nowrap rounded-2xl px-4 py-2 text-sm font-semibold transition ${ + `inline-flex whitespace-nowrap items-center gap-2 rounded-2xl px-4 py-2 text-sm font-semibold transition ${ isActive ? "bg-brand text-white" : "bg-page/70 text-text" }` } > + {link.icon} {link.label} ))}