diff --git a/ipi-survey-platform/src/pages/Admin/configuration/EditCompanyProfile.jsx b/ipi-survey-platform/src/pages/Admin/configuration/EditCompanyProfile.jsx index 0e286f7..6c47bf9 100644 --- a/ipi-survey-platform/src/pages/Admin/configuration/EditCompanyProfile.jsx +++ b/ipi-survey-platform/src/pages/Admin/configuration/EditCompanyProfile.jsx @@ -1162,9 +1162,7 @@ const EditCompanyProfile = () => { if (productLimitMessage) return null; if (checkedCountTotal >= MAX_TOTAL_SELECTED_PRODUCTS || allowedAddCount === 0) { - return ( -

Maximum of {MAX_TOTAL_SELECTED_PRODUCTS} products can be selected.

- ); + return null; } if (newlyAddedCheckedCount >= allowedAddCount) { @@ -1293,12 +1291,33 @@ const EditCompanyProfile = () => {
Selected Products
- - {selectedProducts.filter(p => checkedProducts.has(p.value || p.id || p.product_id)).length}/15 selected - + {(() => { + const checkedCount = selectedProducts.filter(p => checkedProducts.has(p.value || p.id || p.product_id)).length; + const isMaxReached = checkedCount >= 15; + + return ( + + {checkedCount}/15 selected + + ); + })()}
+ {selectedProducts.filter(p => checkedProducts.has(p.value || p.id || p.product_id)).length >= 15 && ( +
+
+ Maximum limit of 15 products reached. Remove a product to add another. +
+
+ )} +
{selectedProducts.length > 0 ? (