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"; import { useEffect } from "react"; import { ensureDemoSeed } from "@/lib/demo-feed"; import { isSupabaseConfigured } from "@/lib/supabase"; interface LayoutProps { children: React.ReactNode; } export default function Layout({ children }: 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: "Get Started", href: "/onboarding" }, { name: "About", href: "/about" }, { name: "Contact", href: "/contact" }, ]; const userNavigation = [ { name: "Dashboard", href: "/dashboard" }, { name: "Feed", href: "/feed" }, { name: "Home", href: "/" }, { name: "About", href: "/about" }, { name: "Contact", href: "/contact" }, ]; const scrollToTop = () => { window.scrollTo({ top: 0, behavior: "smooth" }); }; useEffect(() => { try { if (!isSupabaseConfigured) ensureDemoSeed(); } catch {} }, []); return (
{profile.full_name || profile.username}
{profile.email}