import clsx from 'clsx' import Link from 'next/link' import { Row } from '../layout/row' import { formatPercent } from 'common/util/format' import { Contract, contractPath, getBinaryProbPercent, } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' import { Binary, CPMM, DPM, FreeResponse, FreeResponseContract, FullContract, } from 'common/contract' import { AnswerLabel, BinaryContractOutcomeLabel, FreeResponseOutcomeLabel, } from '../outcome-label' import { getOutcomeProbability, getTopAnswer } from 'common/calculate' import { AbbrContractDetails } from './contract-details' import { TagsList } from '../tags-list' import { CATEGORY_LIST } from 'common/categories' export function ContractCard(props: { contract: Contract showHotVolume?: boolean showCloseTime?: boolean className?: string }) { const { contract, showHotVolume, showCloseTime, className } = props const { question, outcomeType, resolution } = contract const { tags } = contract const categories = tags.filter((tag) => CATEGORY_LIST.includes(tag.toLowerCase()) ) return (
{question}
{outcomeType !== 'FREE_RESPONSE' && categories.length > 0 && (