import { tradingAllowed } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' import { Spacer } from '../layout/spacer' import { ContractProbGraph } from './contract-prob-graph' import { useUser } from 'web/hooks/use-user' import { Row } from '../layout/row' import { Linkify } from '../linkify' import clsx from 'clsx' import { FreeResponseResolutionOrChance, BinaryResolutionOrChance, NumericResolutionOrExpectation, } from './contract-card' import { Bet } from 'common/bet' import BetRow from '../bet-row' import { AnswersGraph } from '../answers/answers-graph' import { Contract } from 'common/contract' import { ContractDescription } from './contract-description' import { ContractDetails } from './contract-details' import { ShareMarket } from '../share-market' import { NumericGraph } from './numeric-graph' export const ContractOverview = (props: { contract: Contract bets: Bet[] className?: string }) => { const { contract, bets, className } = props const { question, creatorId, outcomeType, resolution } = contract const user = useUser() const isCreator = user?.id === creatorId const isBinary = outcomeType === 'BINARY' return (
{isBinary && ( )} {outcomeType === 'NUMERIC' && ( )}
{isBinary ? ( {tradingAllowed(contract) && } ) : ( outcomeType === 'FREE_RESPONSE' && resolution && ( ) )} {outcomeType === 'NUMERIC' && ( )} {isBinary && }{' '} {outcomeType === 'FREE_RESPONSE' && ( )} {outcomeType === 'NUMERIC' && } {(contract.description || isCreator) && } {isCreator && } ) }