diff --git a/src/components/dashboard/DashboardHeader.tsx b/src/components/dashboard/DashboardHeader.tsx index 1997bf5..62b8739 100644 --- a/src/components/dashboard/DashboardHeader.tsx +++ b/src/components/dashboard/DashboardHeader.tsx @@ -1,5 +1,6 @@ import { Bell, Search, User } from "lucide-react"; import { Button } from "@/components/ui/button"; +import { useSidebar } from "../ui/sidebar"; interface DashboardHeaderProps { title: string; @@ -7,8 +8,13 @@ interface DashboardHeaderProps { } export function DashboardHeader({ title, subtitle }: DashboardHeaderProps) { + const sidebar = useSidebar(); + return ( -
+
sidebar.setOpenMobile(true)} + >

{title}

{subtitle && ( @@ -17,14 +23,32 @@ export function DashboardHeader({ title, subtitle }: DashboardHeaderProps) {
- -
-
diff --git a/src/components/dashboard/DashboardLayout.tsx b/src/components/dashboard/DashboardLayout.tsx index 9202589..67f0a3a 100644 --- a/src/components/dashboard/DashboardLayout.tsx +++ b/src/components/dashboard/DashboardLayout.tsx @@ -1,6 +1,7 @@ import { ReactNode } from "react"; import { DashboardSidebar } from "./DashboardSidebar"; import { DashboardHeader } from "./DashboardHeader"; +import { SidebarProvider } from "../ui/sidebar"; interface DashboardLayoutProps { children: ReactNode; @@ -8,16 +9,18 @@ interface DashboardLayoutProps { subtitle?: string; } -export function DashboardLayout({ children, title, subtitle }: DashboardLayoutProps) { +export function DashboardLayout({ + children, + title, + subtitle, +}: DashboardLayoutProps) { return ( -
+
-
- {children} -
+
{children}
-
+ ); } diff --git a/src/components/dashboard/DashboardSidebar.tsx b/src/components/dashboard/DashboardSidebar.tsx index 7bd920e..3f4780a 100644 --- a/src/components/dashboard/DashboardSidebar.tsx +++ b/src/components/dashboard/DashboardSidebar.tsx @@ -1,4 +1,5 @@ -import { useState } from "react"; +"use client"; + import { LayoutGrid, Box, @@ -7,15 +8,29 @@ import { FileText, Settings, Activity, - ChevronLeft, - ChevronRight, Container, + Command, } from "lucide-react"; -import { cn } from "@/lib/utils"; -import { Button } from "@/components/ui/button"; import { usePathname } from "next/navigation"; import Link from "next/link"; +import { + Sidebar, + SidebarContent, + SidebarFooter, + SidebarGroup, + SidebarGroupContent, + SidebarHeader, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, + SidebarRail, + useSidebar, +} from "@/components/ui/sidebar"; +import Image from "next/image"; +import { cn } from "@/lib/utils"; +import { version } from "../../../package.json"; + const navigation = [ { name: "Overview", href: "/overview", icon: LayoutGrid }, { name: "Applications", href: "/applications", icon: Box }, @@ -28,70 +43,69 @@ const navigation = [ ]; export function DashboardSidebar() { - const [collapsed, setCollapsed] = useState(false); - const location = usePathname(); + const pathname = usePathname(); return ( - + + + + ); }