import { ReactNode } from "react"; import { useLocation, useNavigate } from "react-router-dom"; import { Home, PieChart, Plus, MessageSquare, Wallet, Bell, Settings } from "lucide-react"; import { cn } from "@/lib/utils"; import MainStockMenu from "@/components/stock/MainStockMenu"; interface AppLayoutProps { children: ReactNode; } const AppLayout = ({ children }: AppLayoutProps) => { const location = useLocation(); const navigate = useNavigate(); const currentPath = location.pathname; const navItems = [ { icon: Home, label: "Home", path: "/" }, { icon: Wallet, label: "Transactions", path: "/transactions" }, { icon: Plus, label: "Add", path: "/add-transaction", isAction: true }, { icon: PieChart, label: "Reports", path: "/reports" }, { icon: MessageSquare, label: "Messages", path: "/messages" }, ]; // Hide the stock menu on stock management pages const showStockMenu = !currentPath.startsWith('/stock'); return (
{showStockMenu && }
{children}
); }; export default AppLayout;