From 79a31421a4de3c4c8b37d7d1b338a2d2473cb776 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 15 Oct 2025 19:01:13 +0300 Subject: [PATCH] chore(collection/presentation): use note instead of note id --- .../widgets/collections/presentation/index.tsx | 5 +++-- .../collections/presentation/slide_builder.ts | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/apps/client/src/widgets/collections/presentation/index.tsx b/apps/client/src/widgets/collections/presentation/index.tsx index 24b59c047..f912e8d2e 100644 --- a/apps/client/src/widgets/collections/presentation/index.tsx +++ b/apps/client/src/widgets/collections/presentation/index.tsx @@ -7,8 +7,9 @@ export default function PresentationView({ note }: ViewModeProps<{}>) { const containerRef = useRef(null); useEffect(() => { - const presentationEl = buildPresentation(note.noteId); - containerRef.current?.replaceChildren(presentationEl); + buildPresentation(note).then(presentationEl => { + containerRef.current?.replaceChildren(presentationEl); + }); }, [ note ]); return
; diff --git a/apps/client/src/widgets/collections/presentation/slide_builder.ts b/apps/client/src/widgets/collections/presentation/slide_builder.ts index 1bcc63117..fcfdca8d0 100644 --- a/apps/client/src/widgets/collections/presentation/slide_builder.ts +++ b/apps/client/src/widgets/collections/presentation/slide_builder.ts @@ -1,5 +1,13 @@ -export function buildPresentation(parentNoteId: string) { - const p = document.createElement("p"); - p.innerHTML = "Hello world"; - return p; +import FNote from "../../../entities/fnote"; + +export async function buildPresentation(parentNote: FNote) { + const slides = await parentNote.getChildNotes(); + const rootElement = new DocumentFragment(); + + for (const slide of slides) { + const slideEl = document.createElement("div"); + + } + + return rootElement; }