"use client"; import { signOut } from "@/app/login/actions"; import { Button, Card, CardContent } from "poyraz-ui/atoms"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "poyraz-ui/molecules"; import { Sidebar, SidebarBranding, SidebarContent, SidebarFooter, SidebarHeader, SidebarMenu, SidebarMenuItem, SidebarSection, SidebarSeparator, SidebarTrigger, SidebarUserProfile, } from "poyraz-ui/organisms"; import { portalSidebarData } from "@/config/portal-sidebar"; import { cn } from "@/lib/utils"; import { Activity, ChevronUp, LogOut, Menu, Settings } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useState } from "react"; type PortalShellProps = { children: React.ReactNode; user: { email: string; displayName: string; shortName: string; avatarUrl: string | null; }; progress?: number; }; export function PortalShell({ children, user, progress }: PortalShellProps) { const pathname = usePathname(); const [isMobileSidebarOpen, setIsMobileSidebarOpen] = useState(false); return (
{isMobileSidebarOpen ? (
) : null}
Revanios
{children}
); } function AppSidebar({ pathname, user, progress = 0, onNavigate, }: { pathname: string; user: PortalShellProps["user"]; progress?: number; onNavigate?: () => void; }) { return ( Revanios {portalSidebarData.map((group, groupIndex) => (
{group.items.map((item) => { const isActive = item.href === "/portal" ? pathname === "/portal" : item.href ? pathname === item.href || pathname.startsWith(item.href + "/") : false; const Icon = item.icon; return ( : undefined} className={cn(isActive && "font-semibold")} > {item.title} ); })} {groupIndex < portalSidebarData.length - 1 ? ( ) : null}
))}
Proje İlerlemesi
%{progress} Tamamlandı
{user.displayName} {user.email}
Ayarlar
); }