"use client"; import React, { useState } from "react"; import { LogOut, Menu, X } from "lucide-react"; import { Button } from "@/components/ui/button"; import { SidebarNav } from "./sidebar-nav"; import { UserRole } from "@prisma/client"; type DashboardShellProps = { kitaName: string; userName: string; userRole: UserRole; children: React.ReactNode; signOutAction: () => void | Promise; }; export function DashboardShell({ kitaName, userName, userRole, children, signOutAction, }: DashboardShellProps) { const [isOpen, setIsOpen] = useState(false); const displayName = userName; const initials = getInitials(displayName); return (
{/* ── Desktop Sidebar ── */} {/* ── Mobile Top Header Bar ── */}
{kitaName.slice(0, 1).toUpperCase()}

{kitaName}

{/* ── Mobile Sidebar Drawer/Overlay ── */} {isOpen && (
{/* Backdrop */}
setIsOpen(false)} /> {/* Drawer content */}
)} {/* ── Main Content Area ── */}
{children}
); } function getInitials(value: string) { const parts = value.trim().split(/\s+/).filter(Boolean); if (parts.length >= 2) { return `${parts[0][0]}${parts[1][0]}`.toUpperCase(); } return value.slice(0, 2).toUpperCase(); }