"use client";
import { jsx, jsxs } from "../../packages/jsx/src/jsx-runtime.js";
import { Spacing } from "../../tokens/Spacing.js";
import { Icon } from "../../atoms/Icon/Icon.js";
import { Text } from "../../atoms/Text/Text.js";
function InputMessage(props) {
  let { renderIcon } = props;
  const {
    renderIcon: _renderIcon,
    color = "Text",
    severity,
    children,
    ...rest
  } = props;
  if (!renderIcon) {
    switch (severity) {
      case "error":
        renderIcon = (props2) => /* @__PURE__ */ jsx(Icon.FeedbackErrorSmall, { sx: { mt: Spacing["2px"], flexShrink: 0 }, ...props2 });
        break;
      case "warning":
        renderIcon = (props2) => /* @__PURE__ */ jsx(Icon.FeedbackWarningSmall, { sx: { mt: Spacing["2px"], flexShrink: 0 }, ...props2 });
        break;
      case "info":
        renderIcon = (props2) => /* @__PURE__ */ jsx(Icon.FeedbackInfoSmall, { sx: { mt: Spacing["2px"], flexShrink: 0 }, ...props2 });
        break;
      case "success":
        renderIcon = (props2) => /* @__PURE__ */ jsx(Icon.Check, { sx: { mt: Spacing["2px"], flexShrink: 0 }, ...props2, color: "Green" });
        break;
      default:
        throw new Error("InputMessage cannot be rendered without `severity` or `renderIcon` props");
    }
  }
  return /* @__PURE__ */ jsxs(
    Text.P12,
    {
      sx: { mt: Spacing["8px"], mb: 0, py: 0, display: "flex", alignItems: "start", columnGap: Spacing["4px"] },
      color,
      ...rest,
      children: [
        renderIcon({ size: "12px" }),
        children
      ]
    }
  );
}
export {
  InputMessage
};
