feat(react/ribbon): port edited notes

This commit is contained in:
Elian Doran
2025-08-22 17:31:06 +03:00
parent c3eca3b626
commit cee4714665
9 changed files with 101 additions and 111 deletions

View File

@@ -0,0 +1,21 @@
import { useEffect, useMemo, useState } from "preact/hooks";
import link from "../../services/link";
import RawHtml from "./RawHtml";
interface NoteLinkOpts {
notePath: string | string[];
showNotePath?: boolean;
}
export default function NoteLink({ notePath, showNotePath }: NoteLinkOpts) {
const stringifiedNotePath = Array.isArray(notePath) ? notePath.join("/") : notePath;
const [ jqueryEl, setJqueryEl ] = useState<JQuery<HTMLElement>>();
useEffect(() => {
link.createLink(stringifiedNotePath, { showNotePath: true })
.then(setJqueryEl);
}, [ stringifiedNotePath, showNotePath ])
return <RawHtml html={jqueryEl} />
}