Replace "Cancel" with "N/A", for better visual spacing
This commit is contained in:
parent
b14b433417
commit
c00c649fbe
|
@ -26,16 +26,20 @@ export function ContractDetails(props: { contract: Contract }) {
|
||||||
function ContractCard(props: { contract: Contract }) {
|
function ContractCard(props: { contract: Contract }) {
|
||||||
const { contract } = props
|
const { contract } = props
|
||||||
const { probPercent } = compute(contract)
|
const { probPercent } = compute(contract)
|
||||||
const { resolution } = contract
|
|
||||||
|
|
||||||
const resolutionColor =
|
const resolutionColor = {
|
||||||
resolution === 'YES'
|
YES: 'text-primary',
|
||||||
? 'text-primary'
|
NO: 'text-red-400',
|
||||||
: resolution === 'NO'
|
CANCEL: 'text-yellow-400',
|
||||||
? 'text-red-400'
|
'': '', // Empty if unresolved
|
||||||
: resolution === 'CANCEL'
|
}[contract.resolution || '']
|
||||||
? 'text-yellow-400'
|
|
||||||
: ''
|
const resolutionText = {
|
||||||
|
YES: 'YES',
|
||||||
|
NO: 'NO',
|
||||||
|
CANCEL: 'N/A',
|
||||||
|
'': '',
|
||||||
|
}[contract.resolution || '']
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link href={`/contract/${contract.id}`}>
|
<Link href={`/contract/${contract.id}`}>
|
||||||
|
@ -57,7 +61,7 @@ function ContractCard(props: { contract: Contract }) {
|
||||||
<Col
|
<Col
|
||||||
className={'text-4xl mx-auto items-end ' + resolutionColor}
|
className={'text-4xl mx-auto items-end ' + resolutionColor}
|
||||||
>
|
>
|
||||||
{contract.resolution || (
|
{resolutionText || (
|
||||||
<div className="text-primary">
|
<div className="text-primary">
|
||||||
{probPercent}
|
{probPercent}
|
||||||
<div className="text-lg">chance</div>
|
<div className="text-lg">chance</div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user