// The Export stage: take the finished study out as a file, or share it read-only. import { useApp } from '../context/AppContext.js'; import { useShareLink } from '../hooks/useShareLink.js'; import HandoutExport from '../components/HandoutExport.jsx'; import SessionSchedule from '../components/SessionSchedule.jsx'; import CoTeachers from '../components/CoTeachers.jsx'; import LinkRules from '../components/LinkRules.jsx'; import StudioShell from '../components/study/StudioShell.jsx'; import { exportProjectDocx, exportProjectHtml, exportProjectMarkdown, printProjectPdf } from '../utils/projectExport.js'; const card = 'rounded-2xl border border-[var(--r-line)] bg-[var(--r-bar)] p-5'; const btn = 'rounded-xl border border-[var(--r-line)] px-4 py-2 text-sm hover:bg-black/5 disabled:opacity-50'; function Row({ title, note, button, onClick }) { return (

{title}

{note}

); } export default function ExportPage() { const { project, allChunks, setCurrentPage, sharedStudies, deleteProject } = useApp(); const share = useShareLink(project?.id); const filled = allChunks.filter((c) => (c.finalScript ?? '').trim()).length; return (

Export

{allChunks.length} chunk{allChunks.length === 1 ? '' : 's'} · {filled} script{filled === 1 ? '' : 's'} written

Files

exportProjectDocx(project)} /> printProjectPdf(project)} /> exportProjectMarkdown(project)} /> exportProjectHtml(project)} />

Read-only share link

Anyone with the link can view (not edit) this study, with no account needed. Good for a co-teacher or a listener following along.

{share.shareToken ? (
e.target.select()} className="min-w-0 flex-1 truncate rounded-lg border border-[var(--r-line)] bg-[var(--r-bg)] px-3 py-2 text-xs text-[var(--r-sub)]" />
{share.shareError &&

{share.shareError}

}
) : ( )}
{ deleteProject(project.id); setCurrentPage('home'); }} />
setCurrentPage('pronunciation')} />
); }