diff --git a/SettlementModal.tsx b/SettlementModal.tsx index 161e43d6..03cffda3 100644 --- a/SettlementModal.tsx +++ b/SettlementModal.tsx @@ -73,23 +73,73 @@ const SettlementModal: React.FC = ({ {/* INELIGIBLE STATE */} {state === 'ineligible' && (
-
- -
-
-

Ineligible for Settlement

-
-

- {ineligibleReason || 'This commitment does not meet the necessary conditions for settlement at this time.'} -

-
-
- + {(() => { + const reason = ineligibleReason?.toLowerCase() || ''; + let isTemporary = false; + let message = 'This commitment does not meet the necessary conditions for settlement at this time.'; + let iconColor = 'text-red-500'; + let bgColor = 'bg-red-500/10'; + let borderColor = 'border-red-500/20'; + let textColor = 'text-red-400'; + + if (reason.includes('matured') || reason.includes('not matured')) { + isTemporary = true; + message = 'This commitment has not yet reached maturity. Please try again later.'; + iconColor = 'text-yellow-500'; + bgColor = 'bg-yellow-500/10'; + borderColor = 'border-yellow-500/20'; + textColor = 'text-yellow-400'; + } else if (reason.includes('settled') || reason.includes('already settled')) { + message = 'This commitment has already been settled.'; + } else if (reason.includes('disputed') || reason.includes('dispute')) { + message = 'This commitment is under dispute and cannot be settled at this time.'; + } else if (reason.includes('violated')) { + message = 'This commitment has been violated and cannot be settled.'; + } else if (reason.includes('early exit') || reason.includes('early_exit')) { + message = 'This commitment has already been exited early.'; + } + + return ( + <> +
+ {isTemporary ? ( + + ) : ( + + )} +
+
+

+ {isTemporary ? 'Not Ready Yet' : 'Ineligible for Settlement'} +

+
+

{message}

+ {isTemporary && ( +

+ This is a temporary issue—you can try again once the commitment matures. +

+ )} +
+
+
+ {commitmentDetails && ( + + View Commitment Details + + )} + +
+ + ); + })()}
)}