chore(collection/presentation): use note instead of note id

This commit is contained in:
Elian Doran 2025-10-15 19:01:13 +03:00
parent 92e43f5210
commit 79a31421a4
No known key found for this signature in database
2 changed files with 15 additions and 6 deletions

View File

@ -7,8 +7,9 @@ export default function PresentationView({ note }: ViewModeProps<{}>) {
const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => {
const presentationEl = buildPresentation(note.noteId);
containerRef.current?.replaceChildren(presentationEl);
buildPresentation(note).then(presentationEl => {
containerRef.current?.replaceChildren(presentationEl);
});
}, [ note ]);
return <div ref={containerRef} className="presentation" />;

View File

@ -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;
}