diff --git a/apps/client/src/widgets/FloatingButtons.tsx b/apps/client/src/widgets/FloatingButtons.tsx index c0677ab9c..864e9449e 100644 --- a/apps/client/src/widgets/FloatingButtons.tsx +++ b/apps/client/src/widgets/FloatingButtons.tsx @@ -8,6 +8,7 @@ import { useNoteContext } from "./react/hooks"; import { useContext, useEffect, useMemo } from "preact/hooks"; import { ParentComponent } from "./react/react_utils"; import Component from "../components/component"; +import { VNode } from "preact"; interface FloatingButtonContext { parentComponent: Component; @@ -16,18 +17,14 @@ interface FloatingButtonContext { } interface FloatingButtonDefinition { - title: string; - icon: string; + component: (context: FloatingButtonContext) => VNode; isEnabled: (context: FloatingButtonContext) => boolean; - onClick: (context: FloatingButtonContext) => void; } const FLOATING_BUTTON_DEFINITIONS: FloatingButtonDefinition[] = [ { - title: t("backend_log.refresh"), - icon: "bx bx-refresh", + component: RefreshBackendLogButton, isEnabled: ({ note, noteContext }) => note.noteId === "_backendLog" && noteContext.viewScope?.viewMode === "default", - onClick: ({ parentComponent, noteContext }) => parentComponent.triggerEvent("refreshData", { ntxId: noteContext.ntxId }) } ]; @@ -59,12 +56,8 @@ export default function FloatingButtons() { return (