feat(react/floating_buttons): port copy image reference

This commit is contained in:
Elian Doran
2025-08-27 23:56:09 +03:00
parent cc362393be
commit 0ca30e0e87
5 changed files with 37 additions and 54 deletions

View File

@@ -1,5 +1,6 @@
import dayjs from "dayjs";
import type { ViewScope } from "./link.js";
import { FNote } from "./frontend_script_entrypoint.js";
const SVG_MIME = "image/svg+xml";
@@ -574,8 +575,7 @@ function copyHtmlToClipboard(content: string) {
document.removeEventListener("copy", listener);
}
// TODO: Set to FNote once the file is ported.
function createImageSrcUrl(note: { noteId: string; title: string }) {
export function createImageSrcUrl(note: FNote) {
return `api/images/${note.noteId}/${encodeURIComponent(note.title)}?timestamp=${Date.now()}`;
}