'use client'; import { ChevronLeft } from 'lucide-react'; import { useRouter, usePathname } from 'next/navigation'; import { cn } from '@/lib/utils'; import { useMobileChrome } from './mobile-layout-provider'; /** * Fixed mobile topbar (56px + safe-area top inset). Marina-editorial premium: * deep-navy gradient surface with white type, the brand "PN" mark on the * left when there's no back affordance, and a soft glow shadow underneath * for depth instead of a hard divider line. * * Slots: title (auto-truncating), back arrow, primary action — all driven by * `useMobileChrome()` from the active page. When no page has set a title the * URL's last segment is title-cased as a fallback. */ export function MobileTopbar() { const { title, primaryAction, showBackButton } = useMobileChrome(); const router = useRouter(); const pathname = usePathname(); const fallbackTitle = pathname .split('/') .filter(Boolean) .pop() ?.replace(/-/g, ' ') .replace(/\b\w/g, (c) => c.toUpperCase()) ?? 'Port Nimara'; return (
{showBackButton ? ( ) : (
PN
)}

{title ?? fallbackTitle}

{primaryAction}
); }