import Link from 'next/link' import _ from 'lodash' import dayjs from 'dayjs' import { useContract } from '../hooks/use-contract' import { useUserBets } from '../hooks/use-user-bets' import { Bet } from '../lib/firebase/bets' import { User } from '../lib/firebase/users' import { formatMoney, formatPercent } from '../lib/util/format' import { Col } from './layout/col' import { ContractDetails } from './contracts-list' export function BetsList(props: { user: User }) { const { user } = props const bets = useUserBets(user?.id ?? '') if (bets === 'loading') { return <>> } if (bets.length === 0) return
{contract.question}
{formatMoney(amount)} on {outcome}
{formatPercent(probBefore)} → {formatPercent(probAfter)}
{dayjs(createdTime).format('MMM D, H:mma')}