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, roles, 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: "Home", href: "/" },
{ name: "About", href: "/about" },
{ name: "Contact", href: "/contact" },
];
const scrollToTop = () => {
window.scrollTo({ top: 0, behavior: "smooth" });
};
return (
{/* Logo */}
AeThex
{/* Navigation */}
{/* Auth Section */}
{!loading && (
<>
{user ? (
// Logged in - always show Dashboard button; show avatar menu if profile exists
{profile && (
{profile.full_name || profile.username}
{profile.email}
Dashboard
Settings
signOut()}
>
Sign out
)}
) : (
// Not logged in - show sign in/join buttons
<>
>
)}
>
)}
{children}
{/* Supabase Configuration Status */}
);
}