import { contractUrl, 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 { BinaryResolutionOrChance, FreeResponseResolutionOrChance, NumericResolutionOrExpectation, PseudoNumericResolutionOrExpectation, } from './contract-card' import { Bet } from 'common/bet' import BetRow from '../bet-row' import { AnswersGraph } from '../answers/answers-graph' import { Contract, CPMMBinaryContract } from 'common/contract' import { ContractDescription } from './contract-description' import { ContractDetails } from './contract-details' import { NumericGraph } from './numeric-graph' import { CreateChallengeButton } from 'web/components/challenges/create-challenge-button' import React from 'react' import { copyToClipboard } from 'web/lib/util/copy' import toast from 'react-hot-toast' import { LinkIcon } from '@heroicons/react/outline' import { CHALLENGES_ENABLED } from 'common/challenge' 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' const isPseudoNumeric = outcomeType === 'PSEUDO_NUMERIC' const showChallenge = user && isBinary && !resolution && CHALLENGES_ENABLED return (
{isBinary && ( )} {isPseudoNumeric && ( )} {outcomeType === 'NUMERIC' && ( )}
{isBinary ? ( {tradingAllowed(contract) && ( )} ) : isPseudoNumeric ? ( {tradingAllowed(contract) && } ) : isPseudoNumeric ? ( {tradingAllowed(contract) && } ) : ( (outcomeType === 'FREE_RESPONSE' || outcomeType === 'MULTIPLE_CHOICE') && resolution && ( ) )} {outcomeType === 'NUMERIC' && ( )} {(isBinary || isPseudoNumeric) && ( )}{' '} {(outcomeType === 'FREE_RESPONSE' || outcomeType === 'MULTIPLE_CHOICE') && ( )} {outcomeType === 'NUMERIC' && } {/* {(contract.description || isCreator) && } */} {/**/} {/* {showChallenge && (*/} {/* */} {/*
⚔️ Challenge a friend ⚔️
*/} {/* */} {/* */} {/* )}*/} {/* {isCreator && (*/} {/* */} {/*
Share your market
*/} {/* */} {/* */} {/* )}*/} {/*
*/} {showChallenge && ( )} {isCreator && ( )} ) }