fix: multipart form upload icon visibility (#7571)

This commit is contained in:
Pooja
2026-03-27 16:41:36 +05:30
committed by GitHub
parent 9cea60477a
commit 53b75d083f
3 changed files with 89 additions and 24 deletions

View File

@@ -181,11 +181,9 @@ const ResponseExampleMultipartFormParams = ({ item, collection, exampleUid, edit
placeholder: 'Value',
width: '40%',
readOnly: !editMode,
render: ({ row, value, onChange, isLastEmptyRow }) => {
render: ({ row, value, onChange }) => {
const isFile = row.type === 'file';
const fileName = isFile ? getFileName(value) : null;
const hasTextValue = !isFile && value && value.length > 0;
if (fileName) {
return (
<div className="flex items-center file-value-cell">
@@ -220,15 +218,13 @@ const ResponseExampleMultipartFormParams = ({ item, collection, exampleUid, edit
placeholder={!value ? 'Value' : ''}
/>
</div>
{!hasTextValue && !isLastEmptyRow && (
<button
className="upload-btn ml-1"
onClick={() => handleBrowseFiles(row, onChange)}
title="Select file"
>
<IconUpload size={16} />
</button>
)}
<button
className="upload-btn ml-1"
onClick={() => handleBrowseFiles(row, onChange)}
title="Select file"
>
<IconUpload size={16} />
</button>
</div>
);
}