/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import React from "react"; import { observer } from "mobx-react"; import { Select } from "../select"; import hotbarStoreInjectable from "../../../common/hotbars/store.injectable"; import type { CommandOverlay } from "../command-palette"; import { HotbarAddCommand } from "./hotbar-add-command"; import { HotbarRemoveCommand } from "./hotbar-remove-command"; import { HotbarRenameCommand } from "./hotbar-rename-command"; import { withInjectables } from "@ogre-tools/injectable-react"; import commandOverlayInjectable from "../command-palette/command-overlay.injectable"; import type { HotbarStore } from "../../../common/hotbars/store"; const hotbarAddAction = Symbol("hotbar-add"); const hotbarRemoveAction = Symbol("hotbar-remove"); const hotbarRenameAction = Symbol("hotbar-rename"); interface Dependencies { hotbarStore: HotbarStore; commandOverlay: CommandOverlay; } function ignoreIf(check: boolean, menuItems: T[]): T[] { return check ? [] : menuItems; } const NonInjectedHotbarSwitchCommand = observer(({ hotbarStore, commandOverlay, }: Dependencies) => (