import { jsx as e, jsxs as a } from "react/jsx-runtime";
import u from "react";
import h from "../../../form/hooks/useZodForm.js";
import g from "../../../form/Form.js";
import n from "../../../box/Box.js";
import s from "../../Field.js";
import m from "../../../switch/Switch.js";
import c from "../../components/field-label/FieldLabel.js";
import t from "../../components/field-description/FieldDescription.js";
import x from "../../../button/Button.js";
import { o as v, b as p } from "../../../../types-Brp6Qwfh.js";
const b = v({
  marketing: p(),
  updates: p()
}), E = () => {
  const l = h({
    schema: b,
    defaultValues: { marketing: !1, updates: !0 }
  }), i = u.useCallback((r) => {
    alert(JSON.stringify(r, null, 2));
  }, []);
  return /* @__PURE__ */ e(g, { form: l, onSubmit: i, children: /* @__PURE__ */ a(n, { className: "flex flex-col gap-[var(--spacing-4)]", children: [
    /* @__PURE__ */ e(
      s,
      {
        name: "marketing",
        render: ({ field: r, fieldState: o }) => /* @__PURE__ */ a(n, { className: "flex flex-row items-center gap-[var(--spacing-3)]", children: [
          /* @__PURE__ */ e(m, { value: r == null ? void 0 : r.value, onChange: r == null ? void 0 : r.onChange }),
          /* @__PURE__ */ a(n, { className: "flex flex-col", children: [
            /* @__PURE__ */ e(c, { isError: !!(o != null && o.error), children: "Marketing emails" }),
            /* @__PURE__ */ e(t, { children: "Receive offers and promotions" })
          ] })
        ] })
      }
    ),
    /* @__PURE__ */ e(
      s,
      {
        name: "updates",
        render: ({ field: r, fieldState: o }) => /* @__PURE__ */ a(n, { className: "flex flex-row items-center gap-[var(--spacing-3)]", children: [
          /* @__PURE__ */ e(m, { value: r == null ? void 0 : r.value, onChange: r == null ? void 0 : r.onChange }),
          /* @__PURE__ */ a(n, { className: "flex flex-col", children: [
            /* @__PURE__ */ e(c, { isError: !!(o != null && o.error), children: "Product updates" }),
            /* @__PURE__ */ e(t, { children: "Get notified about new features" })
          ] })
        ] })
      }
    ),
    /* @__PURE__ */ e(x, { variant: "default", type: "submit", label: "Save preferences" })
  ] }) });
};
export {
  E as default
};
//# sourceMappingURL=RenderPropFormWrapper.js.map
