import { jsxs, jsx } from "react/jsx-runtime";
import * as React from "react";
import { concat } from "../../utils/classNames.js";
import { useArmstrongConfig } from "../config/config.context.js";
import { Spinner } from "../spinner/spinner.component.js";
import "./status.theme.css.js";
const Status = React.forwardRef(({ pending, error, errorIcon, spinnerIcon, className, ...rest }, ref) => {
  const globals = useArmstrongConfig({
    validationErrorIcon: errorIcon,
    spinnerIcon
  });
  if (!error && !pending) {
    return null;
  }
  return jsxs("div", { ref, className: 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 && jsx(Spinner, { className: "arm-status-spinner", fillContainer: false, icon: globals.spinnerIcon })] });
});
Status.displayName = "Status";
export {
  Status
};
//# sourceMappingURL=status.component.js.map
