fix: conditionally render FieldListContainer based on inputFields length

This commit is contained in:
twwu 2025-05-27 18:19:10 +08:00
parent 70119a054a
commit 377093b776
1 changed files with 10 additions and 8 deletions

View File

@ -45,14 +45,16 @@ const FieldList = ({
<RiAddLine className='h-4 w-4 text-text-tertiary' />
</ActionButton>
</div>
<FieldListContainer
className='flex flex-col gap-y-1 px-4 pb-2'
inputFields={inputFields}
onEditField={handleOpenInputFieldEditor}
onRemoveField={handleRemoveField}
onListSortChange={handleListSortChange}
readonly={readonly}
/>
{inputFields.length > 0 && (
<FieldListContainer
className='flex flex-col gap-y-1 px-4 pb-2'
inputFields={inputFields}
onEditField={handleOpenInputFieldEditor}
onRemoveField={handleRemoveField}
onListSortChange={handleListSortChange}
readonly={readonly}
/>
)}
{showInputFieldEditor && (
<InputFieldEditor
show={showInputFieldEditor}