diff --git a/web/app/components/base/form/components/base/base-field.tsx b/web/app/components/base/form/components/base/base-field.tsx index 4005bab6bc..35ca251a5b 100644 --- a/web/app/components/base/form/components/base/base-field.tsx +++ b/web/app/components/base/form/components/base/base-field.tsx @@ -12,6 +12,7 @@ import PureSelect from '@/app/components/base/select/pure' import type { FormSchema } from '@/app/components/base/form/types' import { FormTypeEnum } from '@/app/components/base/form/types' import { useRenderI18nObject } from '@/hooks/use-i18n' +import Radio from '@/app/components/base/radio' import RadioE from '@/app/components/base/radio/ui' export type BaseFieldProps = { @@ -102,6 +103,12 @@ const BaseField = ({ }) }, [values, show_on]) + const booleanRadioValue = useMemo(() => { + if (value === null || value === undefined) + return undefined + return value ? 1 : 0 + }, [value]) + if (!show) return null @@ -204,6 +211,18 @@ const BaseField = ({ ) } + { + formSchema.type === FormTypeEnum.boolean && ( + field.handleChange(val === 1)} + > + True + False + + ) + } { formSchema.url && (