From 77c926ea54734783284815fbf66c478a192efe71 Mon Sep 17 00:00:00 2001 From: "[dyad]" Date: Fri, 19 Sep 2025 11:49:41 +0200 Subject: [PATCH] [dyad] Fixing sidebar layout on smaller screens - wrote 2 file(s) --- src/components/SidebarNav.tsx | 113 ++++++++++++++++------------------ 1 file changed, 52 insertions(+), 61 deletions(-) diff --git a/src/components/SidebarNav.tsx b/src/components/SidebarNav.tsx index 8fb4bba..c80f134 100644 --- a/src/components/SidebarNav.tsx +++ b/src/components/SidebarNav.tsx @@ -1,66 +1,57 @@ -import { Link, useLocation } from 'react-router-dom'; -import { cn } from '@/lib/utils'; +import { Link, useLocation } from "react-router-dom"; +import { cn } from "@/lib/utils"; +import { buttonVariants } from "@/components/ui/button"; +import { Home, Book, Users, ArrowLeftRight } from "lucide-react"; -interface SidebarNavProps extends React.HTMLAttributes { - onLinkClick?: () => void; +const sidebarNavItems = [ + { + title: "Dashboard", + href: "/", + icon: Home, + }, + { + title: "Books", + href: "/books", + icon: Book, + }, + { + title: "Members", + href: "/members", + icon: Users, + }, + { + title: "Transactions", + href: "/transactions", + icon: ArrowLeftRight, + }, +]; + +interface SidebarNavProps { + onLinkClick?: () => void; } -export function SidebarNav({ className, onLinkClick, ...props }: SidebarNavProps) { - const { pathname } = useLocation(); +export function SidebarNav({ onLinkClick }: SidebarNavProps) { + const { pathname } = useLocation(); - const navItems = [ - { - title: 'Dashboard', - href: '/', - }, - { - title: 'Stock', - href: '/stock', - }, - { - title: 'Book Out Stock', - href: '/book-out', - }, - { - title: 'Customers', - href: '/customers', - }, - { - title: 'Suppliers', // New nav item - href: '/suppliers', - }, - { - title: 'Reports', - href: '/reports', - }, - { - title: 'Purchase Orders', - href: '/purchase-orders', - }, - // Removed Products and Orders - { - title: 'Settings', - href: '/settings', - }, - ]; - - return ( - - ); + return ( + + ); } \ No newline at end of file