"use client"; import { usePathname } from "next/navigation"; import { useAuth } from "@/hooks/use-auth"; import { LogOut } from "lucide-react"; const pageTitles: Record = { "/dashboard": "Dashboard", "/inbox": "Inbox", "/contacts": "Contacts", "/pipelines": "Pipelines", "/broadcasts": "Broadcasts", "/automations": "Automations", "/settings": "Settings", }; function getPageTitle(pathname: string): string { if (pageTitles[pathname]) return pageTitles[pathname]; const match = Object.entries(pageTitles).find(([path]) => pathname.startsWith(path) ); return match ? match[1] : "Dashboard"; } export function Header() { const pathname = usePathname(); const { profile, signOut } = useAuth(); const title = getPageTitle(pathname); return (

{title}

{profile?.full_name?.charAt(0)?.toUpperCase() ?? "U"}

{profile?.full_name ?? "User"}

); }