import { jsx } from "react/jsx-runtime";
import {
  DSFormLayoutBlockItem
} from "@elliemae/ds-form-layout-blocks";
import { useFormState, get } from "react-hook-form";
const FormLayoutBlockItem = ({
  inputID,
  label,
  ...rest
}) => {
  const { errors } = useFormState({ name: inputID });
  const errorField = get(errors, inputID);
  const hasError = !!errorField;
  const validationMessage = errorField?.message;
  return /* @__PURE__ */ jsx(
    DSFormLayoutBlockItem,
    {
      inputID,
      label,
      hasError,
      validationMessage,
      ...rest
    }
  );
};
export {
  FormLayoutBlockItem
};
