"use client" import { usePathname } from "next/navigation" import Link from "next/link" import { Plus, CreditCard, Wrench, FileText, Receipt, CalendarDays } from "lucide-react" import { NotificationsBell } from "@/components/dashboard/notifications-bell" import { CommandTrigger } from "@/components/dashboard/command-palette" const pageTitles: Record = { "/dashboard": "Dashboard", "/properties": "Properties", "/tenants": "Tenants", "/rent": "Rent Tracker", "/maintenance": "Maintenance", "/leases": "Leases", "/expenses": "Expenses", "/settings/profile": "Settings", "/settings/billing": "Billing", "/settings/demo": "Demo Data", "/ai": "AI Assistant", "/reports": "Reports", "/rent/generate": "Generate Rent", "/vendors": "Vendors", "/inspections": "Inspections", "/calendar": "Calendar", } const pageActions: Record = { "/dashboard": { label: "Add Property", href: "/properties/new" }, "/properties": { label: "Add Property", href: "/properties/new" }, "/tenants": { label: "Add Tenant", href: "/tenants/new" }, "/rent/generate": { label: "Rent Tracker", href: "/rent", icon: CreditCard }, "/rent": { label: "Record Payment", href: "/rent/new", icon: CreditCard }, "/maintenance": { label: "New Request", href: "/maintenance/new", icon: Wrench }, "/leases": { label: "New Lease", href: "/leases/new", icon: FileText }, "/expenses": { label: "Add Expense", href: "/expenses/new", icon: Receipt }, } export function Header() { const pathname = usePathname() const title = Object.entries(pageTitles).find(([path]) => path === "/dashboard" ? pathname === path : pathname.startsWith(path) )?.[1] ?? "Property Management Network" const action = Object.entries(pageActions).find(([path]) => path === "/dashboard" ? pathname === path : pathname.startsWith(path) )?.[1] const ActionIcon = action?.icon ?? Plus return (

{title}

{action && ( {action.label} )}
) }