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); const containerRef = useRef<HTMLDivElement>(null);
useEffect(() => { useEffect(() => {
const presentationEl = buildPresentation(note.noteId); buildPresentation(note).then(presentationEl => {
containerRef.current?.replaceChildren(presentationEl); containerRef.current?.replaceChildren(presentationEl);
});
}, [ note ]); }, [ note ]);
return <div ref={containerRef} className="presentation" />; return <div ref={containerRef} className="presentation" />;

View File

@ -1,5 +1,13 @@
export function buildPresentation(parentNoteId: string) { import FNote from "../../../entities/fnote";
const p = document.createElement("p");
p.innerHTML = "Hello world"; export async function buildPresentation(parentNote: FNote) {
return p; const slides = await parentNote.getChildNotes();
const rootElement = new DocumentFragment();
for (const slide of slides) {
const slideEl = document.createElement("div");
}
return rootElement;
} }