fix(header): update boolean form type to checkbox and improve JSX formatting in form input component

This commit is contained in:
twwu 2025-09-02 16:26:41 +08:00
parent dfb967773b
commit 273dae6738
2 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ export enum FormTypeEnum {
secretInput = 'secret-input',
select = 'select',
radio = 'radio',
boolean = 'boolean',
boolean = 'checkbox',
files = 'files',
file = 'file',
modelSelector = 'model-selector',

View File

@ -94,8 +94,8 @@ const FormInputItem: FC<Props> = ({
// return VarType.appSelector
// else if (isModelSelector)
// return VarType.modelSelector
// else if (isBoolean)
// return VarType.boolean
else if (isBoolean)
return VarType.boolean
else if (isObject)
return VarType.object
else if (isArray)
@ -187,7 +187,7 @@ const FormInputItem: FC<Props> = ({
return (
<div className={cn('gap-1', !(isShowJSONEditor && isConstant) && 'flex')}>
{showTypeSwitch && (
<FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange}/>
<FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange} />
)}
{isString && (
<MixedVariableTextInput
@ -209,7 +209,7 @@ const FormInputItem: FC<Props> = ({
placeholder={placeholder?.[language] || placeholder?.en_US}
/>
)}
{isBoolean && (
{isBoolean && isConstant && (
<FormInputBoolean
value={varInput?.value as boolean}
onChange={handleValueChange}