import { jsxDEV } from "react/jsx-dev-runtime";
import { useMutationState } from "@contember/binding";
import { Button, Icon } from "@contember/ui";
import { useClassName } from "@contember/utilities";
import { memo } from "react";
const defaultIconProps = {
  blueprintIcon: "add",
  style: {
    marginRight: "0.2em",
    position: "relative",
    top: "0.05em"
  }
};
const CreateNewEntityButton = memo(
  ({ createNewEntity, iconProps, children = "Add", ...buttonProps }) => {
    const isMutating = useMutationState();
    return /* @__PURE__ */ jsxDEV(
      Button,
      {
        onClick: () => createNewEntity(),
        disabled: isMutating,
        loading: isMutating,
        className: useClassName("new-entity-button"),
        distinction: "seamless",
        justification: "justifyStart",
        ...buttonProps,
        children: [
          /* @__PURE__ */ jsxDEV(Icon, { ...defaultIconProps, ...iconProps }, void 0, false, {
            fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/helpers/CreateNewEntityButton.tsx",
            lineNumber: 49,
            columnNumber: 5
          }, globalThis),
          children
        ]
      },
      void 0,
      true,
      {
        fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/collections/helpers/CreateNewEntityButton.tsx",
        lineNumber: 39,
        columnNumber: 4
      },
      globalThis
    );
  }
);
export {
  CreateNewEntityButton
};
//# sourceMappingURL=CreateNewEntityButton.js.map
