"use client"; import { Menu, ArrowLeft, Plus, Search, X } from "lucide-react"; import { Button } from "@/components/ui/button"; import { useUIStore } from "@/stores/ui-store"; import { useIsDesktop } from "@/hooks/use-media-query"; import { cn } from "@/lib/utils"; import { useTranslations } from "next-intl"; interface MobileHeaderProps { title: string; showBack?: boolean; onBack?: () => void; onCompose?: () => void; onSearch?: () => void; className?: string; } export function MobileHeader({ title, showBack = false, onBack, onCompose, onSearch, className, }: MobileHeaderProps) { const t = useTranslations('sidebar'); const { toggleSidebar, goBack, sidebarOpen } = useUIStore(); // Pane-aware: in Pro split mode the viewport is desktop-wide while the // pane is narrow. The Tailwind `lg:hidden` variant alone would never fire // there, so we additionally hide via JS when the surrounding pane is // desktop-sized. Outside of Pro this still returns the viewport value. const isPaneDesktop = useIsDesktop(); if (isPaneDesktop) return null; const handleLeftAction = () => { if (showBack && onBack) { onBack(); } else if (showBack) { goBack(); } else { toggleSidebar(); } }; return (
{/* Left action: Menu or Back button */}
{/* Title */}

{title}

{/* Right actions */}
{onSearch && ( )} {onCompose && ( )}
); } /** * Viewer header for mobile - shows when viewing an email */ interface MobileViewerHeaderProps { subject?: string; onBack: () => void; onDelete?: () => void; onArchive?: () => void; className?: string; } export function MobileViewerHeader({ subject, onBack, onDelete: _onDelete, onArchive: _onArchive, className, }: MobileViewerHeaderProps) { const t = useTranslations('sidebar'); const isPaneDesktop = useIsDesktop(); if (isPaneDesktop) return null; return (

{subject || "(No Subject)"}

{/* Placeholder for additional actions - kept minimal */}
); }