import type { ReactNode } from "react" import { NavLink, useLocation, useNavigate } from "react-router-dom" import { BellRing, CalendarClock, Globe, LogOut, Users, LayoutTemplate, SquareTerminal } from "lucide-react" import { useAuth } from "@/auth/AuthContext" import { Button } from "@/components/ui/button" import { cn } from "@/lib/utils" const NAV = [ { to: "/domains", label: "Domains", icon: Globe }, { to: "/accounts", label: "Accounts", icon: Users }, { to: "/templates", label: "Templates", icon: LayoutTemplate }, { to: "/schedule", label: "Schedule", icon: CalendarClock }, { to: "/channels", label: "Channels", icon: BellRing }, ] as const export function Layout({ children }: { children: ReactNode }) { const location = useLocation() const navigate = useNavigate() const { user, logout } = useAuth() async function onLogout() { await logout() navigate("/login", { replace: true }) } return (
{location.pathname} {user && (
{user.email}
)}
{children}
) }