import {
  Icon
} from "./chunk-TKIP5Q5H.js";
import {
  TextOrHTML
} from "./chunk-KTJCAQT4.js";

// src/components/ErrorMessage/ErrorMessage.tsx
import { error } from "@simplybusiness/icons";
import classNames from "classnames/dedupe";
import "@simplybusiness/mobius/src/components/ErrorMessage/ErrorMessage.css";
import { jsx, jsxs } from "react/jsx-runtime";
var ErrorMessage = ({
  id,
  errorMessage,
  className
}) => {
  const classes = classNames("mobius", "mobius-error-message", className);
  if (!errorMessage) return null;
  return /* @__PURE__ */ jsxs("div", { id, className: classes, "data-testid": "ErrorMessage", role: "alert", children: [
    /* @__PURE__ */ jsx(
      Icon,
      {
        icon: error,
        className: "mobius-error-message__icon",
        "aria-hidden": "true"
      }
    ),
    /* @__PURE__ */ jsx(
      TextOrHTML,
      {
        elementType: "span",
        className: "mobius-error-message__text",
        text: errorMessage
      }
    )
  ] });
};
ErrorMessage.displayName = "ErrorMessage";

export {
  ErrorMessage
};
//# sourceMappingURL=chunk-MZJT3USG.js.map
