feat: paginate React cards like print

This commit is contained in:
user
2026-07-17 09:49:21 +02:00
parent b8b122abb9
commit 0816f27053
5 changed files with 115 additions and 23 deletions
+17 -12
View File
@@ -163,6 +163,7 @@ type Section = {
id: string;
index: number;
title: string;
show_heading: boolean;
header_html: string;
left_margin_html: string;
right_margin_html: string;
@@ -182,7 +183,7 @@ type CardModel = {
total_pages: number;
front: any;
sections: Section[];
dictionary: { header_html: string; content_html: string };
dictionary: { header_html: string; content_html: string } | null;
toc: { id: string; label: string }[];
};
type NvimPanelSummary = {
@@ -2714,10 +2715,12 @@ function SectionPage({
className="section-sheet"
>
<div id={section.id} className="section-anchor" />
<h2 className="section-heading">
<span className="section-index">{section.index}</span>
<span className="section-title">{section.title}</span>
</h2>
{section.show_heading && (
<h2 className="section-heading">
<span className="section-index">{section.index}</span>
<span className="section-title">{section.title}</span>
</h2>
)}
<StepMap steps={section.steps} progress={progress} onCycle={onCycle} />
{section.content_html && <Html html={section.content_html} />}
<div className="tasks">
@@ -3117,13 +3120,15 @@ function App({ model }: { model: CardModel }) {
/>
);
})}
<Sheet
header={model.dictionary.header_html}
className="dictionary-sheet"
>
<h2>Słownik WE/EN/EK/KW</h2>
<Html html={model.dictionary.content_html} />
</Sheet>
{model.dictionary && (
<Sheet
header={model.dictionary.header_html}
className="dictionary-sheet"
>
<h2>Słownik WE/EN/EK/KW</h2>
<Html html={model.dictionary.content_html} />
</Sheet>
)}
</main>
<ProgressDock progress={progress} error={progressError} />
<ShortcutHelp open={shortcutsOpen} onClose={() => setShortcutsOpen(false)} />