import { tradingAllowed } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' import { ContractChart } from 'web/components/charts/contract' import { useUser } from 'web/hooks/use-user' import { Row } from '../layout/row' import { Linkify } from '../linkify' import { BinaryResolutionOrChance, FreeResponseResolutionOrChance, NumericResolutionOrExpectation, PseudoNumericResolutionOrExpectation, } from './contract-card' import { Bet } from 'common/bet' import BetButton, { BinaryMobileBetting } from '../bet-button' import { Contract, CPMMContract, FreeResponseContract, MultipleChoiceContract, NumericContract, PseudoNumericContract, BinaryContract, } from 'common/contract' import { ContractDetails } from './contract-details' import { ContractReportResolution } from './contract-report-resolution' import { SizedContainer } from 'web/components/sized-container' const OverviewQuestion = (props: { text: string }) => ( ) const BetWidget = (props: { contract: CPMMContract }) => { const user = useUser() return ( {!user && (
(with play money!)
)} ) } const SizedContractChart = (props: { contract: Contract bets: Bet[] fullHeight: number mobileHeight: number }) => { const { fullHeight, mobileHeight, contract, bets } = props return ( {(width, height) => ( )} ) } const NumericOverview = (props: { contract: NumericContract; bets: Bet[] }) => { const { contract, bets } = props return ( ) } const BinaryOverview = (props: { contract: BinaryContract; bets: Bet[] }) => { const { contract, bets } = props return ( {contract.isResolved && ( )} {tradingAllowed(contract) && ( )} ) } const ChoiceOverview = (props: { contract: FreeResponseContract | MultipleChoiceContract bets: Bet[] }) => { const { contract, bets } = props const { question, resolution } = contract return ( {resolution && ( )} ) } const PseudoNumericOverview = (props: { contract: PseudoNumericContract bets: Bet[] }) => { const { contract, bets } = props return ( {tradingAllowed(contract) && } ) } export const ContractOverview = (props: { contract: Contract bets: Bet[] }) => { const { contract, bets } = props switch (contract.outcomeType) { case 'BINARY': return case 'NUMERIC': return case 'PSEUDO_NUMERIC': return case 'FREE_RESPONSE': case 'MULTIPLE_CHOICE': return } }