diff --git a/apps/client/src/widgets/buttons/revisions_button.ts b/apps/client/src/widgets/buttons/revisions_button.ts deleted file mode 100644 index 089c6a4c6..000000000 --- a/apps/client/src/widgets/buttons/revisions_button.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { t } from "../../services/i18n.js"; -import CommandButtonWidget from "./command_button.js"; - -export default class RevisionsButton extends CommandButtonWidget { - constructor() { - super(); - - this.icon("bx-history").title(t("revisions_button.note_revisions")).command("showRevisions").titlePlacement("bottom").class("icon-action"); - } - - isEnabled() { - return super.isEnabled() && !["launcher", "doc"].includes(this.note?.type ?? ""); - } -} diff --git a/apps/client/src/widgets/react/ActionButton.tsx b/apps/client/src/widgets/react/ActionButton.tsx index a6a1ee740..9fa0e69b4 100644 --- a/apps/client/src/widgets/react/ActionButton.tsx +++ b/apps/client/src/widgets/react/ActionButton.tsx @@ -1,14 +1,19 @@ +import { CommandNames } from "../../components/app_context"; + interface ActionButtonProps { text: string; + titlePosition?: "bottom"; // TODO: Use it icon: string; className?: string; onClick?: (e: MouseEvent) => void; + triggerCommand?: CommandNames; } -export default function ActionButton({ text, icon, className, onClick }: ActionButtonProps) { +export default function ActionButton({ text, icon, className, onClick, triggerCommand }: ActionButtonProps) { return