refactor: enhance button loading states and styling in editor and sidebar components

This commit is contained in:
Anish Sarkar 2026-04-22 23:06:49 +05:30
parent 6ac5256431
commit 336bd57c4d
4 changed files with 31 additions and 30 deletions

View file

@ -763,22 +763,16 @@ export function DocumentUploadTab({
</div>
<Button
className="w-full"
className="w-full relative"
onClick={handleUpload}
disabled={isAnyUploading || fileCount === 0}
>
{isAnyUploading ? (
<span className="flex items-center gap-2">
<Spinner size="sm" />
{t("uploading")}
</span>
) : (
<span className="flex items-center gap-2">
{folderUpload
? t("upload_folder_button", { count: fileCount })
: t("upload_button", { count: fileCount })}
</span>
)}
<span className={isAnyUploading ? "opacity-0" : ""}>
{folderUpload
? t("upload_folder_button", { count: fileCount })
: t("upload_button", { count: fileCount })}
</span>
{isAnyUploading && <Spinner size="sm" className="absolute" />}
</Button>
</div>
)}