diff --git a/apps/client/src/widgets/react/LinkButton.tsx b/apps/client/src/widgets/react/LinkButton.tsx
index a9596c972..81e2943a1 100644
--- a/apps/client/src/widgets/react/LinkButton.tsx
+++ b/apps/client/src/widgets/react/LinkButton.tsx
@@ -1,16 +1,20 @@
import { ComponentChild } from "preact";
+import { CommandNames } from "../../components/app_context";
interface LinkButtonProps {
- onClick: () => void;
+ onClick?: () => void;
text: ComponentChild;
+ triggerCommand?: CommandNames;
}
-export default function LinkButton({ onClick, text }: LinkButtonProps) {
+export default function LinkButton({ onClick, text, triggerCommand }: LinkButtonProps) {
return (
- {
- e.preventDefault();
- onClick();
- }}>
+ {
+ e.preventDefault();
+ if (onClick) onClick();
+ }}>
{text}
)
diff --git a/apps/client/src/widgets/ribbon/NotePathsTab.tsx b/apps/client/src/widgets/ribbon/NotePathsTab.tsx
index d639a8928..18d5086d6 100644
--- a/apps/client/src/widgets/ribbon/NotePathsTab.tsx
+++ b/apps/client/src/widgets/ribbon/NotePathsTab.tsx
@@ -3,11 +3,12 @@ import { useEffect, useMemo, useState } from "preact/hooks";
import FNote, { NotePathRecord } from "../../entities/fnote";
import { t } from "../../services/i18n";
import { NOTE_PATH_TITLE_SEPARATOR } from "../../services/tree";
-import Button from "../react/Button";
import { useTriliumEvent } from "../react/hooks";
import NoteLink from "../react/NoteLink";
import { joinElements } from "../react/react_utils";
import { TabContext } from "./ribbon-interface";
+import LinkButton from "../react/LinkButton";
+
export default function NotePathsTab({ note, hoistedNoteId, notePath }: TabContext) {
const sortedNotePaths = useSortedNotePaths(note, hoistedNoteId);
@@ -35,9 +36,9 @@ export function NotePathsWidget({ sortedNotePaths, currentNotePath }: {
)) : undefined}
-
>