diff --git a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/index.tsx b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/index.tsx index 264db94d..3ff52286 100644 --- a/src/front/Components/Layouts/Folder/FolderInformation/ClientView/index.tsx +++ b/src/front/Components/Layouts/Folder/FolderInformation/ClientView/index.tsx @@ -39,14 +39,17 @@ export default function ClientView(props: IProps) { const tabs = useMemo( () => - customers.map((customer) => ({ - label: `${customer.contact?.first_name} ${customer.contact?.last_name}`, - key: customer.uid, - value: customer, - hasWarning: - customer.documents && - customer.documents.filter((document) => document.document_status === EDocumentStatus.DEPOSITED).length > 0, - })), + customers + .map((customer) => ({ + label: `${customer.contact?.first_name} ${customer.contact?.last_name}`, + key: customer.uid, + value: customer, + hasWarning: + customer.documents && + customer.documents.filter((document) => document.document_status === EDocumentStatus.DEPOSITED).length > 0, + })) + // put every tabs that has warning first + .sort((a, b) => (a.hasWarning ? -1 : 1)), [customers], );