"use client"; import { signOut } from "@/app/login/actions"; import { Button } from "poyraz-ui/atoms"; import { Sidebar, SidebarBranding, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuItem, SidebarSection, SidebarSeparator, SidebarTrigger, SidebarUserProfile, } from "poyraz-ui/organisms"; import { sidebarData } from "@/config/sidebar"; import { cn } from "@/lib/utils"; import { LogOut, Menu } from "lucide-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useState } from "react"; type DashboardShellProps = { children: React.ReactNode; user: { email: string; displayName: string; shortName: string; avatarUrl: string | null; }; }; export function DashboardShell({ children, user }: DashboardShellProps) { const pathname = usePathname(); const [isMobileSidebarOpen, setIsMobileSidebarOpen] = useState(false); return (
{isMobileSidebarOpen ? (
) : null}
C Cognis
{children}
); } function AppSidebar({ pathname, user, onNavigate, }: { pathname: string; user: DashboardShellProps["user"]; onNavigate?: () => void; }) { return ( C } /> {sidebarData.map((group) => ( {group.items.map((item) => { const isActive = item.href === "/" ? pathname === "/" : item.href ? pathname === item.href || pathname.startsWith(item.href + "/") : false; const Icon = item.icon; return ( : undefined} className={cn(isActive && "font-semibold")} > {item.title} ); })} ))}
); }