diff --git a/apps/client/src/widgets/NoteDetail.tsx b/apps/client/src/widgets/NoteDetail.tsx index 4ad3743444..e902a400e9 100644 --- a/apps/client/src/widgets/NoteDetail.tsx +++ b/apps/client/src/widgets/NoteDetail.tsx @@ -14,7 +14,7 @@ import toast from "../services/toast.js"; import { dynamicRequire, isElectron, isMobile } from "../services/utils"; import { ExtendedNoteType, TYPE_MAPPINGS, TypeWidget } from "./note_types"; import { useNoteContext, useTriliumEvent } from "./react/hooks"; -import NoteList from "./react/NoteList"; +import { NoteListWithLinks } from "./react/NoteList"; import { TypeWidgetProps } from "./type_widgets/type_widget"; /** @@ -200,7 +200,7 @@ export default function NoteDetail() { api.dismissToast(); dialog.info(<>

{t("note_detail.print_report_collection_details_ignored_notes")}

- + , { title: t("note_detail.print_report_title"), size: "md" diff --git a/apps/client/src/widgets/react/NoteList.tsx b/apps/client/src/widgets/react/NoteList.tsx index 59a9f858b6..9f8e585f7b 100644 --- a/apps/client/src/widgets/react/NoteList.tsx +++ b/apps/client/src/widgets/react/NoteList.tsx @@ -1,7 +1,9 @@ +import type { CSSProperties } from "preact/compat"; import { useEffect, useState } from "preact/hooks"; + import type FNote from "../../entities/fnote"; import froca from "../../services/froca"; -import type { CSSProperties } from "preact/compat"; +import NoteLink from "./NoteLink"; interface NoteListProps { noteIds?: string[]; @@ -33,4 +35,24 @@ export default function NoteList({ noteIds, branchIds, style }: NoteListProps) { ))} ); -} \ No newline at end of file +} + +export function NoteListWithLinks({ noteIds }: { + noteIds: string[] +}) { + const [ notes, setNotes ] = useState([]); + + useEffect(() => { + froca.getNotes(noteIds).then((notes) => setNotes(notes)); + }, [ noteIds ]); + + return (notes && +
    + {notes.map(note => ( +
  • + +
  • + ))} +
+ ); +}