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 { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { User, Settings, LogOut, Bell } from "lucide-react"; interface LayoutProps { children: React.ReactNode; } export default function Layout({ children }: LayoutProps) { const location = useLocation(); const { user, profile, signOut, loading } = useAuth(); const navigation = [ { name: "Home", href: "/" }, { name: "Get Started", href: "/onboarding" }, { name: "About", href: "/about" }, { name: "Contact", href: "/contact" }, ]; const userNavigation = [ { name: "Dashboard", href: "/dashboard" }, { name: "Profile", href: "/profile" }, { name: "Home", href: "/" }, { name: "About", href: "/about" }, { name: "Contact", href: "/contact" }, ]; const scrollToTop = () => { window.scrollTo({ top: 0, behavior: "smooth" }); }; return (
{/* Logo */}
AeThex Logo AeThex
{/* Navigation */} {/* Auth Section */}
{!loading && ( <> {user && profile ? ( // Logged in user menu

{profile.full_name || profile.username}

{profile.email}

Dashboard Profile Settings signOut()} > Sign out
) : ( // Not logged in - show sign in/join buttons <> )} )}
{children}
{/* Supabase Configuration Status */}
); }