// Shared frame for every stage of a study project (Outline, Study, Script, // Export): themed like the Reader, with a slim bar that carries the project title, // the stage switcher, and save/sync status. import { useApp } from '../../context/AppContext.js'; import { themeVars, READER_THEMES } from '../reader/readerThemes.js'; import HomeButton from '../reader/HomeButton.jsx'; export const STAGES = [ { id: 'setup', label: 'Chunks' }, { id: 'study', label: 'Study' }, { id: 'outline', label: 'Outline' }, { id: 'script', label: 'Script' }, { id: 'export', label: 'Finish' }, ]; const THEME_ORDER = ['paper', 'sepia', 'dark']; export default function StudioShell({ stage, loading = false, fixedHeight = false, children }) { const { goHome, setCurrentPage, project, allChunks, saveStatus, syncStatus, retrySync, syncConflict, keepMyVersion, useServerVersion, mergeBothVersions, readerTheme, setReaderTheme, } = useApp(); const noChunks = allChunks.length === 0; const cycleTheme = () => setReaderTheme(THEME_ORDER[(THEME_ORDER.indexOf(readerTheme) + 1) % THEME_ORDER.length]); return (
{project?.title ?? ''}
{loading ? Loading… : saveStatus ? {saveStatus} : syncStatus === 'syncing' ? Syncing… : syncStatus === 'synced' ? Saved : syncStatus === 'error' ? ( Sync failed ) : null}
{syncConflict && project && syncConflict.id === project.id && (
This study was changed on another device. Your edits here are saved on this device, but not yet synced.
)} {children}
); }