It now holds files, sharing, handouts, slides, importing notes, schedule, co-teachers and earlier versions, not just exports. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
31 lines
2.2 KiB
React
31 lines
2.2 KiB
React
// Finish → Slides: a printable slide deck for a session or the whole study (Save as PDF in the print dialog).
|
||
import { useState } from 'react';
|
||
import { sessionsFor } from '../utils/handout.js';
|
||
import { printSlides } from '../utils/slides.js';
|
||
|
||
export default function SlidesExport({ project }) {
|
||
const sessions = sessionsFor(project);
|
||
const [which, setWhich] = useState('all');
|
||
const [dark, setDark] = useState(false);
|
||
const [blocked, setBlocked] = useState(false);
|
||
if (sessions.length === 0) return null;
|
||
const go = () => setBlocked(!printSlides(project, which === 'all' ? null : [which], { dark }));
|
||
return (
|
||
<section className="rounded-2xl border border-[var(--r-line)] bg-[var(--r-bar)] p-5" aria-label="Slides">
|
||
<h2 className="text-sm font-medium">Slides</h2>
|
||
<p className="mb-3 mt-1 text-xs text-[var(--r-sub)]">A 16:9 slide for each session’s passage, each outline point (with the verse it quotes) and the discussion questions. Choose “Save as PDF” in the print dialog, then open it in any slide viewer or project it from the PDF. It isn’t a PowerPoint file.</p>
|
||
<div className="flex flex-wrap items-end gap-3">
|
||
<label className="text-xs text-[var(--r-sub)]">Sessions
|
||
<select value={which} onChange={(e) => setWhich(e.target.value)} className="mt-1 block rounded-lg border border-[var(--r-line)] bg-[var(--r-bg)] px-2.5 py-1.5 text-sm text-[var(--r-text)]">
|
||
<option value="all">All {sessions.length}</option>
|
||
{sessions.map((s) => <option key={s.chunk.id} value={s.chunk.id}>{s.number}. {s.reference}</option>)}
|
||
</select>
|
||
</label>
|
||
<label className="flex items-center gap-2 pb-2 text-xs text-[var(--r-sub)]"><input type="checkbox" checked={dark} onChange={(e) => setDark(e.target.checked)} className="accent-[var(--r-accent)]" /> Dark slides</label>
|
||
<button type="button" onClick={go} className="rounded-xl border border-[var(--r-line)] px-4 py-2 text-sm hover:bg-black/5">Print / Save PDF</button>
|
||
</div>
|
||
{blocked && <p role="alert" className="mt-2 text-xs text-[var(--r-danger,#b42318)]">Allow pop-ups for this site to print the slides.</p>}
|
||
</section>
|
||
);
|
||
}
|