import React from 'react' import { tradingAllowed } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' import { BinaryContractChart, NumericContractChart, PseudoNumericContractChart, ChoiceContractChart, } 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' const OverviewQuestion = (props: { text: string }) => ( ) const BetWidget = (props: { contract: CPMMContract }) => { const user = useUser() return ( {!user && (
(with play money!)
)} ) } const NumericOverview = (props: { contract: NumericContract }) => { const { contract } = props return ( ) } const BinaryOverview = (props: { contract: BinaryContract; bets: Bet[] }) => { const { contract, bets } = props return ( {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 } }