| 16 | * Tap targets are at least 44×44 px per WCAG / Apple HIG guidelines. |
| 17 | */ |
| 18 | export function MobileHeader({ |
| 19 | title = "Chat", |
| 20 | onMenuOpen, |
| 21 | onBack, |
| 22 | right, |
| 23 | className, |
| 24 | }: MobileHeaderProps) { |
| 25 | return ( |
| 26 | <header |
| 27 | className={cn( |
| 28 | "flex items-center gap-2 px-2 border-b border-surface-800 bg-surface-900/80 backdrop-blur-sm", |
| 29 | "h-[52px] flex-shrink-0", |
| 30 | className |
| 31 | )} |
| 32 | > |
| 33 | {/* Left action — back or hamburger */} |
| 34 | {onBack ? ( |
| 35 | <button |
| 36 | onClick={onBack} |
| 37 | className="min-w-[44px] min-h-[44px] flex items-center justify-center rounded-md text-surface-400 hover:text-surface-100 active:bg-surface-800 transition-colors" |
| 38 | aria-label="Go back" |
| 39 | > |
| 40 | <ChevronLeft className="w-5 h-5" /> |
| 41 | </button> |
| 42 | ) : ( |
| 43 | <button |
| 44 | onClick={onMenuOpen} |
| 45 | className="min-w-[44px] min-h-[44px] flex items-center justify-center rounded-md text-surface-400 hover:text-surface-100 active:bg-surface-800 transition-colors" |
| 46 | aria-label="Open sidebar" |
| 47 | > |
| 48 | <Menu className="w-5 h-5" /> |
| 49 | </button> |
| 50 | )} |
| 51 | |
| 52 | {/* Title */} |
| 53 | <h1 className="flex-1 text-sm font-medium text-surface-100 truncate">{title}</h1> |
| 54 | |
| 55 | {/* Right actions */} |
| 56 | {right && <div className="flex items-center">{right}</div>} |
| 57 | </header> |
| 58 | ); |
| 59 | } |