import { jsx } from "react/jsx-runtime";
import { u as useFormContext, C as Controller } from "../../../index.esm-D7jRhDaG.js";
import BaseFormFieldSecret from "../../vendor/FormFieldSecret.js";
const FormFieldSecret = ({
  name,
  label,
  error,
  ...otherProps
}) => {
  const {
    control,
    formState: { errors }
  } = useFormContext();
  return /* @__PURE__ */ jsx(
    Controller,
    {
      name,
      control,
      render: ({ field }) => {
        var _a;
        return /* @__PURE__ */ jsx(
          BaseFormFieldSecret,
          {
            label,
            error: (error == null ? void 0 : error.message) ?? ((_a = errors[name]) == null ? void 0 : _a.message),
            ...otherProps,
            ...field
          }
        );
      }
    }
  );
};
export {
  FormFieldSecret
};
//# sourceMappingURL=FormFieldSecret.js.map
