diff --git a/web/components/contracts-list.tsx b/web/components/contracts-list.tsx index e3f43e0b..9c98692c 100644 --- a/web/components/contracts-list.tsx +++ b/web/components/contracts-list.tsx @@ -26,16 +26,20 @@ export function ContractDetails(props: { contract: Contract }) { function ContractCard(props: { contract: Contract }) { const { contract } = props const { probPercent } = compute(contract) - const { resolution } = contract - const resolutionColor = - resolution === 'YES' - ? 'text-primary' - : resolution === 'NO' - ? 'text-red-400' - : resolution === 'CANCEL' - ? 'text-yellow-400' - : '' + const resolutionColor = { + YES: 'text-primary', + NO: 'text-red-400', + CANCEL: 'text-yellow-400', + '': '', // Empty if unresolved + }[contract.resolution || ''] + + const resolutionText = { + YES: 'YES', + NO: 'NO', + CANCEL: 'N/A', + '': '', + }[contract.resolution || ''] return ( @@ -57,7 +61,7 @@ function ContractCard(props: { contract: Contract }) { - {contract.resolution || ( + {resolutionText || (
{probPercent}
chance