Files
Trilium/apps/client/src/print.tsx

27 lines
581 B
TypeScript
Raw Normal View History

import { JSX } from "preact/jsx-runtime";
import FNote from "./entities/fnote";
import { render } from "preact";
async function main() {
const noteId = window.location.pathname.split("/")[2];
const froca = (await import("./services/froca")).default;
const note = await froca.getNote(noteId);
if (!note) return;
let el: JSX.Element | null = null;
if (note.type === "book") {
el = handleCollection(note);
}
render(el, document.body);
}
function handleCollection(note: FNote) {
return (
<h1>{note.title}</h1>
);
}
main();