generated from plutack/nextjsauth-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmobile-sidebar.tsx
35 lines (34 loc) · 1.04 KB
/
mobile-sidebar.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"use client";
import { DashboardNav } from "@/components/dashboard-nav";
import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";
import { navItems } from "@/constants/data";
import { MenuIcon } from "lucide-react";
import { useState } from "react";
export function MobileSidebar() {
const [open, setOpen] = useState(false);
return (
<>
<Sheet open={open} onOpenChange={setOpen}>
<SheetTrigger asChild>
<MenuIcon />
</SheetTrigger>
<SheetContent side="left" className="!px-0">
<div className="space-y-4 py-4">
<div className="px-3 py-2">
<h2 className="mb-2 px-4 text-lg font-semibold tracking-tight">
Overview
</h2>
<div className="space-y-1">
<DashboardNav
items={navItems}
isMobileNav={true}
setOpen={setOpen}
/>
</div>
</div>
</div>
</SheetContent>
</Sheet>
</>
);
}