"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require$$0 = require("react/jsx-runtime");
const designSystem = require("@choiceform/design-system");
const iconsReact = require("@choiceform/icons-react");
const React = require("react");
const index = require("../../../../i18n/index.cjs");
const markdown = require("../../../common/markdown/markdown.cjs");
const MessageErrorTv = designSystem.tcv({
  slots: {
    root: "error-message border-danger-foreground/50 flex flex-col gap-2 rounded-lg border border-dashed p-2",
    content: "text-danger-foreground flex items-center gap-2 font-strong"
  }
});
const MessageError = React.memo(function MessageError2(props) {
  const { children, className } = props;
  const tv = MessageErrorTv();
  const title = index.t("response", "error-title");
  const content = typeof children === "string" ? children : children?.toString();
  return /* @__PURE__ */ require$$0.jsxs("div", { className: designSystem.tcx(tv.root(), className), children: [
    /* @__PURE__ */ require$$0.jsxs("div", { className: tv.content(), children: [
      /* @__PURE__ */ require$$0.jsx(iconsReact.WarningTriangle, {}),
      /* @__PURE__ */ require$$0.jsx("span", { className: "text-message", children: title })
    ] }),
    content && /* @__PURE__ */ require$$0.jsx(markdown.Markdown, { children: content })
  ] });
});
exports.MessageError = MessageError;
//# sourceMappingURL=message-error.cjs.map
