From 561931876f151ba9ccc4793422457479f7d9922d Mon Sep 17 00:00:00 2001 From: AmirReza Jamali Date: Sat, 27 Jun 2026 10:31:24 +0330 Subject: [PATCH] fix(forms): add loading state for company document removal Block uploads and other document actions while a file is being removed, and show per-item and global loading feedback until deletion completes. Co-authored-by: Cursor --- .../companies/documents/CompanyDocuments.tsx | 21 ++++++++++-- .../companies/documents/DocumentItem.tsx | 17 ++++++---- .../documents/useCompanyDocumentsPresenter.ts | 33 ++++++++++++++----- 3 files changed, 54 insertions(+), 17 deletions(-) diff --git a/src/components/forms/companies/documents/CompanyDocuments.tsx b/src/components/forms/companies/documents/CompanyDocuments.tsx index b13a84c..670b52b 100644 --- a/src/components/forms/companies/documents/CompanyDocuments.tsx +++ b/src/components/forms/companies/documents/CompanyDocuments.tsx @@ -13,6 +13,8 @@ interface IProps { const CompanyDocuments = ({ companyId, value, onChange }: IProps) => { const { isUploading, + isBusy, + removingFileId, uploadProgress, failed, errorMessage, @@ -32,11 +34,16 @@ const CompanyDocuments = ({ companyId, value, onChange }: IProps) => { accept={DOCUMENT_FILE_ACCEPT} className="sr-only" onChange={onSelectFiles} - disabled={isUploading} + disabled={isBusy} />