chore(collection/presentation): separate slide builder

This commit is contained in:
Elian Doran 2025-10-15 18:54:10 +03:00
parent 025f22553f
commit 92e43f5210
No known key found for this signature in database
2 changed files with 17 additions and 2 deletions

View File

@ -1,5 +1,15 @@
import { useEffect, useRef, useState } from "preact/hooks";
import { ViewModeProps } from "../interface";
import { buildPresentation } from "./slide_builder";
export default function PresentationView({ }: ViewModeProps<{}>) {
return <p>Presentation goes here.</p>;
export default function PresentationView({ note }: ViewModeProps<{}>) {
const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => {
const presentationEl = buildPresentation(note.noteId);
containerRef.current?.replaceChildren(presentationEl);
}, [ note ]);
return <div ref={containerRef} className="presentation" />;
}

View File

@ -0,0 +1,5 @@
export function buildPresentation(parentNoteId: string) {
const p = document.createElement("p");
p.innerHTML = "Hello world";
return p;
}