From bdef408abed15d7d509a550147883316e1298d07 Mon Sep 17 00:00:00 2001 From: jyswee Date: Thu, 23 Jul 2026 22:10:40 +0000 Subject: [PATCH] Seed: dashboard template (24 files) --- src/components/Sidebar.tsx | 105 +++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/components/Sidebar.tsx diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx new file mode 100644 index 0000000..d92cb41 --- /dev/null +++ b/src/components/Sidebar.tsx @@ -0,0 +1,105 @@ +import { useState } from "react"; +import { Link } from "react-router-dom"; +import { Button } from "@/components/ui/button"; +import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet"; +import { Separator } from "@/components/ui/separator"; +import { + LayoutDashboard, BarChart3, Users, FileText, Settings, + User, LogOut, ChevronLeft, Activity +} from "lucide-react"; +import { useAuth } from "@/hooks/use-tygarun"; + +interface SidebarProps { + activePath: string; +} + +const navItems = [ + { label: "Dashboard", icon: LayoutDashboard, path: "/" }, + { label: "Analytics", icon: BarChart3, path: "/analytics" }, + { label: "Users", icon: Users, path: "/users" }, + { label: "Reports", icon: FileText, path: "/reports" }, + { label: "Settings", icon: Settings, path: "/settings" }, + { label: "Profile", icon: User, path: "/profile" }, +]; + +function SidebarContent({ activePath }: SidebarProps) { + const { user, isSignedIn, signin, signout } = useAuth(); + const displayName = user?.name || user?.email || "Sarah Mitchell"; + const displayRole = user?.role || "Admin"; + const initials = displayName.split(" ").map((p) => p[0]).join("").slice(0, 2).toUpperCase(); + return ( +
+
+ {/* ── Logo ── */} +
+ +
+ +
+
+

MetricFlow

+

Analytics Dashboard

+
+ +
+ + + + {/* ── Navigation ── */} + + + + + {/* ── User + Logout ── */} +
+
+
+ {initials} +
+
+

{displayName}

+

{displayRole}

+
+
+ +
+
+ ); +} + +export default function Sidebar({ activePath }: SidebarProps) { + return ( + <> + {/* Desktop Sidebar */} + + + ); +} + +export { SidebarContent };