diff --git a/inventory/src/components/layout/MainLayout.tsx b/inventory/src/components/layout/MainLayout.tsx index 65fce6a..05bc0e0 100644 --- a/inventory/src/components/layout/MainLayout.tsx +++ b/inventory/src/components/layout/MainLayout.tsx @@ -1,118 +1,24 @@ -import { useState } from 'react'; -import { NavLink, useLocation } from 'react-router-dom'; -import { - LayoutDashboard, - Settings, - Package, - ShoppingBag, - PackagePlus, - BarChart4, - LogOut, -} from 'lucide-react'; -import { cn } from '@/lib/utils'; -import { Button } from '../ui/button'; -import { useNavigate } from 'react-router-dom'; +import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar"; +import { AppSidebar } from "./AppSidebar"; -const links = [ - { title: 'Dashboard', path: '/', icon: }, - { title: 'Products', path: '/products', icon: }, - { title: 'Import', path: '/import', icon: }, - { title: 'Orders', path: '/orders', icon: }, - { title: 'Purchase Orders', path: '/purchase-orders', icon: }, - { title: 'Analytics', path: '/analytics', icon: }, - { title: 'Settings', path: '/settings', icon: }, -]; - -export function MainLayout({ children }: { children: React.ReactNode }) { - const [open, setOpen] = useState(true); - const location = useLocation(); - const navigate = useNavigate(); - - const handleLogout = () => { - sessionStorage.removeItem('isLoggedIn'); - sessionStorage.removeItem('token'); - navigate('/login'); - }; +interface MainLayoutProps { + children: React.ReactNode; +} +export function MainLayout({ children }: MainLayoutProps) { return ( -
- -
{children}
-
+ +
+ +
+
+ +
+
+ {children} +
+
+
+
); } \ No newline at end of file diff --git a/inventory/src/index.css b/inventory/src/index.css index 8666096..a1bcfde 100644 --- a/inventory/src/index.css +++ b/inventory/src/index.css @@ -82,8 +82,8 @@ --sidebar-background: 240 5.9% 10%; --sidebar-foreground: 240 4.8% 95.9%; - --sidebar-primary: 0 0% 98%; - --sidebar-primary-foreground: 240 5.9% 10%; + --sidebar-primary: 224.3 76.3% 48%; + --sidebar-primary-foreground: 0 0% 100%; --sidebar-accent: 240 3.7% 15.9%; --sidebar-accent-foreground: 240 4.8% 95.9%; --sidebar-border: 240 3.7% 15.9%; diff --git a/inventory/src/pages/Login.tsx b/inventory/src/pages/Login.tsx index a589677..cc588ab 100644 --- a/inventory/src/pages/Login.tsx +++ b/inventory/src/pages/Login.tsx @@ -46,7 +46,7 @@ export function Login() { console.log('Login response status:', response.status); if (!response.ok) { - const data = await response.json().catch(e => ({ error: 'Failed to parse error response' })); + const data = await response.json().catch(() => ({ error: 'Failed to parse error response' })); console.error('Login failed:', data); throw new Error(data.error || 'Login failed'); }