import { jsxs, Fragment, jsx } from "react/jsx-runtime";
import { useArmstrongConfig } from "../config/config.context.js";
import { Status } from "../status/status.component.js";
const StatusWrapper = ({ statusPosition, error, pending, errorIcon, validationMode, children, className }) => {
  const globals = useArmstrongConfig({
    validationErrorIcon: errorIcon,
    validationMode,
    inputStatusPosition: statusPosition
  });
  const shouldShowErrorIcon = (globals.validationMode === "both" || globals.validationMode === "icon") && !!error;
  return jsxs(Fragment, { children: [globals.inputStatusPosition === "left" && jsx(Status, { className, error: shouldShowErrorIcon, pending, errorIcon: globals.validationErrorIcon, "data-position": "left" }), children, globals.inputStatusPosition === "right" && jsx(Status, { className, error: shouldShowErrorIcon, pending, errorIcon: globals.validationErrorIcon, "data-position": "right" })] });
};
export {
  StatusWrapper
};
//# sourceMappingURL=statusWrapper.component.js.map
