"use client";
import { signOut } from "@/app/login/actions";
import { Button } from "@/components/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { sidebarData } from "@/config/sidebar";
import { cn } from "@/lib/utils";
import { AnimatePresence, motion } from "framer-motion";
import { ChevronDown, LogOut, Menu, Settings2 } from "lucide-react";
import Image from "next/image";
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);
const closeMobileSidebar = () => setIsMobileSidebarOpen(false);
return (
{/* Desktop Sidebar */}
{/* Mobile Sidebar */}
{isMobileSidebarOpen ? (
) : null}
{/* Main Content Area (Scrollable internally) */}
{/* Mobile Menu Button */}
Cognis
);
}
function SidebarPanel({
pathname,
user,
desktop = false,
onNavigate,
}: {
pathname: string;
user: DashboardShellProps["user"];
desktop?: boolean;
onNavigate?: () => void;
}) {
return (
);
}
function Avatar({ user }: { user: DashboardShellProps["user"] }) {
if (user.avatarUrl) {
return (
{/* eslint-disable-next-line @next/next/no-img-element */}
);
}
return (
{user.shortName}
);
}
function AmbientBackdrop() {
return (
<>
>
);
}