import { useFormContext as e } from "react-hook-form";
//#region src/components/dynamic-form/hooks/useFieldConfig.ts
var t = (t, n, r, i) => {
	let a = e()?.formState.errors[t], o = r;
	return {
		fieldLabel: o?.title ?? n.title ?? t,
		helpText: o?.help ?? n.help,
		description: o?.description ?? n.description,
		isReadOnly: o?.readonly ?? n.readonly,
		isDisabled: o?.disabled ?? n.disabled ?? i,
		defaultValue: n.default,
		error: a,
		getAriaProps: () => ({
			"aria-describedby": o?.description ?? n.description ? `${t}-description` : void 0,
			"aria-invalid": !!a
		})
	};
};
//#endregion
export { t as useFieldConfig };
