import { memo, createElement } from "react";
import { useMutationState } from "@contember/binding";
import { useClassNamePrefix, Button, Icon } from "@contember/ui";
const defaultIconProps = {
  blueprintIcon: "add",
  style: {
    marginRight: "0.2em",
    position: "relative",
    top: "0.05em"
  }
};
const CreateNewEntityButton = memo(({ createNewEntity, iconProps, children = "Add", ...buttonProps }) => {
  const isMutating = useMutationState();
  const prefix = useClassNamePrefix();
  return /* @__PURE__ */ createElement(Button, {
    onClick: () => createNewEntity(),
    disabled: isMutating,
    loading: isMutating,
    className: `${prefix}new-entity-button`,
    distinction: "seamless",
    justification: "justifyStart",
    ...buttonProps
  }, /* @__PURE__ */ createElement(Icon, {
    ...defaultIconProps,
    ...iconProps
  }), children);
});
export { CreateNewEntityButton };
//# sourceMappingURL=CreateNewEntityButton.js.map
