Fixed Empty Document Name Upload

This commit is contained in:
Arnab Ghosh
2024-01-16 15:35:48 +05:30
parent ad2221a677
commit 0752aae9ef

View File

@@ -207,9 +207,11 @@ export default function Upload({
<button
onClick={uploadFile}
className={`ml-6 rounded-3xl bg-purple-30 text-white ${
files.length > 0 ? '' : 'bg-opacity-75 text-opacity-80'
files.length > 0 && docName.trim().length > 0
? ''
: 'bg-opacity-75 text-opacity-80'
} py-2 px-6`}
disabled={files.length === 0} // Disable the button if no file is selected
disabled={files.length === 0 || docName.trim().length === 0} // Disable the button if no file is selected or docName is empty
>
Train
</button>