import clsx from 'clsx' import dayjs from 'dayjs' import React from 'react' import { Contract } from '../lib/firebase/contracts' import { formatMoney } from '../lib/util/format' import { Col } from './layout/col' import { Spacer } from './layout/spacer' export function ResolvedPanel(props: { contract: Contract className?: string }) { const { contract, className } = props const { resolution, resolutionTime, pot, seedAmounts } = contract const total = pot.YES + pot.NO - seedAmounts.YES - seedAmounts.NO const color = resolution === 'YES' ? 'text-primary' : resolution === 'NO' ? 'text-red-400' : resolution === 'CANCEL' ? 'text-yellow-400' : 'text-gray-500' return (
Resolved: {resolution}
{dayjs(resolutionTime).format('MMM D, HH:mma')}
{resolution === 'YES' ? ( <>Yes bettors have collectively won {formatMoney(total)}. ) : resolution === 'NO' ? ( <>No bettors have collectively won {formatMoney(total)}. ) : ( <>All bets have been returned. )}
) }