+
{bodyChildren}
)}
diff --git a/frontend/src/components/ui/form-field.tsx b/frontend/src/components/ui/form-field.tsx
index 03ba0da791..7d12046aaf 100644
--- a/frontend/src/components/ui/form-field.tsx
+++ b/frontend/src/components/ui/form-field.tsx
@@ -5,6 +5,7 @@ import * as React from 'react';
import { cn } from '@/lib/utils';
import { useI18n } from '@/contexts/i18n-context';
import { getNamePathString } from '@/lib/form';
+import { InfoTooltip } from '@/components/ui/tooltip';
import type { BaseFormFieldProps, FormFieldProps } from '@/types/form';
import { useFormContext } from './form';
@@ -50,6 +51,7 @@ function getDefaultValue(value: any, valuePropName: string) {
function FormField({
name,
+ hidden = false,
label,
extra,
rules,
@@ -59,6 +61,7 @@ function FormField({
valuePropName = 'value',
layout = 'vertical',
className,
+ tooltip,
normalize,
}: FormFieldProps) {
const { t } = useI18n();
@@ -132,6 +135,14 @@ function FormField({
};
}, [form, fieldKey, registerField, unregisterField]);
+ if (hidden) {
+ return null;
+ }
+
+ if (!children) {
+ throw new Error('FormField requires children unless hidden is true');
+ }
+
const handleChange = (nextValueOrEvent: any, ...args: any[]) => {
const rawValue = nextValueOrEvent?.target ? nextValueOrEvent.target.value : nextValueOrEvent;
@@ -179,10 +190,10 @@ function FormField({
)}
>
{label && (
-
) : (
-