'use client'; import { ArrowLeft } from 'lucide-react'; import { useI18n } from '@/lib/hooks/use-i18n'; import { useRouter } from 'next/navigation'; import type { StageMode } from '@/lib/types/stage'; import { HeaderControls } from './stage/header-controls'; interface HeaderProps { readonly currentSceneTitle: string; readonly mode?: StageMode; readonly canEdit?: boolean; readonly onToggleEditMode?: () => void; } export function Header({ currentSceneTitle, mode, canEdit, onToggleEditMode }: HeaderProps) { const { t } = useI18n(); const router = useRouter(); return ( <>
{/* Title block — hidden when `mode === 'edit'`. Header lives inside `PlaybackChromeRoot`, which is unmounted by `Stage` once mode flips to 'edit', so in steady state this branch is always taken. The guard exists for the ~280ms AnimatePresence exit window where the playback chrome is still rendering its exit animation while `mode` has already flipped — without the guard, this title would briefly stack on top of the incoming EditChromeRoot's CommandBar title during the cross-fade. */} {mode !== 'edit' && (
{t('stage.currentScene')}

{currentSceneTitle || t('common.loading')}

)}
); }