import { Link, useLocation } from "react-router-dom"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import SupabaseStatus from "./SupabaseStatus"; import { useAuth } from "@/contexts/AuthContext"; import NotificationBell from "@/components/notifications/NotificationBell"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger, } from "@/components/ui/sheet"; import { User, Settings, LogOut, Sparkles, UserCircle, Menu, } from "lucide-react"; interface LayoutProps { children: React.ReactNode; hideFooter?: boolean; } export default function CodeLayout({ children, hideFooter }: LayoutProps) { const location = useLocation(); const { user, profile, roles, signOut, loading, profileComplete } = useAuth(); const isOwner = Array.isArray(roles) && roles.includes("owner"); const navigation = [ { name: "Home", href: "/" }, { name: "Realms", href: "/realms" }, { name: "Get Started", href: "/onboarding" }, { name: "Engage", href: "/engage" }, { name: "Roadmap", href: "/roadmap" }, { name: "Projects", href: "/projects" }, { name: "Teams", href: "/teams" }, { name: "Squads", href: "/squads" }, { name: "Mentee Hub", href: "/mentee-hub" }, { name: "Directory", href: "/directory" }, { name: "Developers", href: "/developers" }, { name: "Opportunities", href: "/opportunities" }, { name: "About", href: "/about" }, { name: "Contact", href: "/contact" }, ]; const publicNavigation = [ { name: "Home", href: "/" }, { name: "About", href: "/about" }, { name: "Blog", href: "/blog" }, { name: "Community", href: "/community" }, { name: "Contact", href: "/contact" }, { name: "Documentation", href: "/docs" }, ]; const userNavigation = [ { name: "Dashboard", href: "/dashboard" }, { name: "Realms", href: "/realms" }, { name: "Teams", href: "/teams" }, { name: "Squads", href: "/squads" }, { name: "Mentee Hub", href: "/mentee-hub" }, { name: "Feed", href: "/feed" }, { name: "Engage", href: "/engage" }, { name: "Roadmap", href: "/roadmap" }, { name: "Projects", href: "/projects" }, { name: "Developers", href: "/developers" }, { name: "Opportunities", href: "/opportunities" }, { name: "Home", href: "/" }, { name: "About", href: "/about" }, { name: "Contact", href: "/contact" }, ]; const passportHref = profile?.username ? `/passport/${profile.username}` : "/passport/me"; const navItems: { name: string; href: string }[] = []; const scrollToTop = () => { window.scrollTo({ top: 0, behavior: "smooth" }); }; return (
{/* Logo */}
AeThex Logo AeThex
{/* Navigation */}
{children}
{!hideFooter && ( )} {/* Supabase Configuration Status */}
); }