import { jsx as r } from "react/jsx-runtime";
import t from "react";
import { F as m, a as o, d as s } from "../../../../FormPrimitives-CuaI5fdh.js";
const u = ({
  name: n,
  control: d,
  ...e
}) => {
  if (e.render)
    return /* @__PURE__ */ r(
      m,
      {
        name: n,
        control: d,
        render: (...i) => /* @__PURE__ */ r(o, { children: e.render(...i) })
      }
    );
  if (e.children)
    return /* @__PURE__ */ r(
      m,
      {
        name: n,
        control: d,
        render: ({ field: i, fieldState: a }) => {
          var l;
          return /* @__PURE__ */ r(o, { children: /* @__PURE__ */ r(s, { children: t.cloneElement(e.children, {
            ...i,
            "aria-invalid": a.invalid ? "true" : "false",
            errorMessage: (l = a.error) == null ? void 0 : l.message
          }) }) });
        }
      }
    );
};
export {
  u as default
};
//# sourceMappingURL=FormField.js.map
