"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
const classNames = require("../../utils/classNames.cjs");
const config_context = require("../config/config.context.cjs");
const spinner_component = require("../spinner/spinner.component.cjs");
require("./status.theme.css.cjs");
function _interopNamespaceDefault(e) {
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
  if (e) {
    for (const k in e) {
      if (k !== "default") {
        const d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: () => e[k]
        });
      }
    }
  }
  n.default = e;
  return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
const Status = React__namespace.forwardRef(({ pending, error, errorIcon, spinnerIcon, className, ...rest }, ref) => {
  const globals = config_context.useArmstrongConfig({
    validationErrorIcon: errorIcon,
    spinnerIcon
  });
  if (!error && !pending) {
    return null;
  }
  return jsxRuntime.jsxs("div", { ref, className: classNames.concat("arm-status", className), "data-active": !!pending || !!error ? true : void 0, "data-error": !!error && !pending ? true : void 0, "data-pending": pending ? true : void 0, role: "status", ...rest, children: [error && !pending && globals.validationErrorIcon, pending && jsxRuntime.jsx(spinner_component.Spinner, { className: "arm-status-spinner", fillContainer: false, icon: globals.spinnerIcon })] });
});
Status.displayName = "Status";
exports.Status = Status;
//# sourceMappingURL=status.component.cjs.map
