import { Contract, getBinaryProbPercent, tradingAllowed, } from '../lib/firebase/contracts' import { Col } from './layout/col' import { Spacer } from './layout/spacer' import { ContractProbGraph } from './contract-prob-graph' import { useUser } from '../hooks/use-user' import { Row } from './layout/row' import { Linkify } from './linkify' import clsx from 'clsx' import { ContractDetails, ResolutionOrChance } from './contract-card' import { Bet } from '../../common/bet' import { Comment } from '../../common/comment' import { RevealableTagsInput, TagsInput } from './tags-input' import BetRow from './bet-row' import { Fold } from '../../common/fold' import { FoldTagList } from './tags-list' import { ContractActivity } from './feed/contract-activity' import { AnswersGraph } from './answers/answers-graph' import { DPM, FreeResponse, FullContract } from '../../common/contract' export const ContractOverview = (props: { contract: Contract bets: Bet[] comments: Comment[] folds: Fold[] children?: any className?: string }) => { const { contract, bets, comments, folds, children, className } = props const { question, resolution, creatorId, outcomeType } = contract const user = useUser() const isCreator = user?.id === creatorId const isBinary = outcomeType === 'BINARY' const allowTrade = tradingAllowed(contract) return (
{/* {(isBinary || resolution) && ( )} */}
{/* {isBinary && allowTrade && ( {(isBinary || resolution) && ( )} {isBinary && tradingAllowed(contract) && ( )} )} */} {isBinary ? ( ) : ( } bets={bets} /> )} {children} {folds.length === 0 ? ( ) : ( )} {folds.length === 0 ? ( ) : ( )} {folds.length > 0 && ( )} ) } function Triangle(props: { direction: 'up' | 'down' width: number color: string className?: string }) { const { direction, width, color, className } = props return (
{/* {direction === 'up' && (
M$
)} {direction === 'down' && (
M$
)} */}
) } function QuickBetWidget(props: { contract: Contract }) { const { contract } = props return (
Click to trade
{getBinaryProbPercent(contract)}
) }