import clsx from 'clsx' import Link from 'next/link' import { Row } from '../layout/row' import { formatLargeNumber, formatPercent } from 'common/util/format' import { contractPath, getBinaryProbPercent, submissionPath, } from 'web/lib/firebase/contracts' import { Col } from '../layout/col' import { BinaryContract, Contract, FreeResponseContract, MultipleChoiceContract, NumericContract, PseudoNumericContract, } from 'common/contract' import { AnswerLabel, BinaryContractOutcomeLabel, CancelLabel, FreeResponseOutcomeLabel, } from '../outcome-label' import { getOutcomeProbability, getProbability, getTopAnswer, } from 'common/calculate' import { AvatarDetails, MiscDetails, ShowTime, } from '../contract/contract-details' import { getExpectedValue, getValueFromBucket } from 'common/calculate-dpm' import { getColor, ProbBar, QuickBet } from '../contract/quick-bet' import { useContractWithPreload } from 'web/hooks/use-contract' import { useUser } from 'web/hooks/use-user' import { track } from '@amplitude/analytics-browser' import { trackCallback } from 'web/lib/service/analytics' import { formatNumericProbability } from 'common/pseudo-numeric' import { Title } from '../title' import { contest_data } from 'common/contest' import { default as causeExploration } from 'web/lib/util/contests/causeExploration.json' //this is super gross, need to figure out how to not hardcode this function getSubmissionData(contestSlug: string) { if (contestSlug === 'cause-exploration-prize') { return causeExploration } } export function SubmissionCard(props: { contract: Contract showHotVolume?: boolean showTime?: ShowTime className?: string onClick?: () => void hideQuickBet?: boolean hideGroupLink?: boolean contestSlug: string }) { const { showHotVolume, showTime, className, onClick, hideQuickBet, hideGroupLink, contestSlug, } = props const contract = useContractWithPreload(props.contract) ?? props.contract const { question, outcomeType } = contract const { resolution } = contract const user = useUser() const marketClosed = (contract.closeTime || Infinity) < Date.now() || !!resolution const showQuickBet = user && !marketClosed && (outcomeType === 'BINARY' || outcomeType === 'PSEUDO_NUMERIC') && !hideQuickBet const submissionData = getSubmissionData(contract.slug) console.log(submissionData) return (
{question}