feat(layout/note_actions): integrate add child for relation map

This commit is contained in:
Elian Doran
2025-12-15 09:07:45 +02:00
parent 35cfcc59f6
commit d7722a1e05

View File

@@ -54,6 +54,7 @@ export default function NoteActionsCustom(props: NoteActionsCustomProps) {
return (innerProps &&
<div className="note-actions-custom">
<AddChildButton {...innerProps} />
<RunActiveNoteButton {...innerProps } />
<OpenTriliumApiDocsButton {...innerProps} />
<SwitchSplitOrientationButton {...innerProps} />
@@ -221,4 +222,13 @@ function OpenTriliumApiDocsButton({ noteMime }: NoteActionsCustomInnerProps) {
onClick={() => openInAppHelpFromUrl(noteMime.endsWith("frontend") ? "Q2z6av6JZVWm" : "MEtfsqa5VwNi")}
/>;
}
function AddChildButton({ parentComponent, noteType, ntxId }: NoteActionsCustomInnerProps) {
const isEnabled = noteType === "relationMap";
return isEnabled && <ActionButton
icon="bx bx-folder-plus"
text={t("relation_map_buttons.create_child_note_title")}
onClick={() => parentComponent.triggerEvent("relationMapCreateChildNote", { ntxId })}
/>;
}
//#endregion