import { jsx } from "react/jsx-runtime";
import { track, useEditor } from "@cmpd/editor";
import { useActions } from "../hooks/useActions.mjs";
import { useReadonly } from "../hooks/useReadonly.mjs";
import { useTranslation } from "../hooks/useTranslation/useTranslation.mjs";
import { Button } from "./primitives/Button.mjs";
import { kbdStr } from "./primitives/shared.mjs";
const TrashButton = track(function TrashButton2() {
  const editor = useEditor();
  const actions = useActions();
  const msg = useTranslation();
  const action = actions["delete"];
  const isReadonly = useReadonly();
  if (isReadonly)
    return null;
  return /* @__PURE__ */ jsx(
    Button,
    {
      icon: action.icon,
      type: "icon",
      onClick: () => action.onSelect("quick-actions"),
      disabled: !(editor.isIn("select") && editor.getSelectedShapeIds().length > 0),
      title: `${msg(action.label)} ${kbdStr(action.kbd)}`,
      smallIcon: true
    }
  );
});
export {
  TrashButton
};
//# sourceMappingURL=TrashButton.mjs.map
