2022-08-04 21:27:02 +00:00
|
|
|
import React, { useEffect, useMemo, useState } from 'react'
|
2022-04-11 21:13:26 +00:00
|
|
|
import { ArrowLeftIcon } from '@heroicons/react/outline'
|
2022-08-04 21:27:02 +00:00
|
|
|
import { groupBy, keyBy, mapValues, sortBy, sumBy } from 'lodash'
|
2021-12-16 03:14:00 +00:00
|
|
|
|
2022-05-09 13:04:36 +00:00
|
|
|
import { useContractWithPreload } from 'web/hooks/use-contract'
|
|
|
|
import { ContractOverview } from 'web/components/contract/contract-overview'
|
|
|
|
import { BetPanel } from 'web/components/bet-panel'
|
|
|
|
import { Col } from 'web/components/layout/col'
|
2022-08-04 21:27:02 +00:00
|
|
|
import { useUser, useUserById } from 'web/hooks/use-user'
|
2022-05-09 13:04:36 +00:00
|
|
|
import { ResolutionPanel } from 'web/components/resolution-panel'
|
|
|
|
import { Spacer } from 'web/components/layout/spacer'
|
2022-01-02 04:52:55 +00:00
|
|
|
import {
|
|
|
|
Contract,
|
|
|
|
getContractFromSlug,
|
2022-01-26 20:08:03 +00:00
|
|
|
tradingAllowed,
|
2022-05-09 13:04:36 +00:00
|
|
|
} from 'web/lib/firebase/contracts'
|
|
|
|
import { SEO } from 'web/components/SEO'
|
|
|
|
import { Page } from 'web/components/page'
|
|
|
|
import { Bet, listAllBets } from 'web/lib/firebase/bets'
|
|
|
|
import { Comment, listAllComments } from 'web/lib/firebase/comments'
|
2022-01-16 03:09:15 +00:00
|
|
|
import Custom404 from '../404'
|
2022-05-09 13:04:36 +00:00
|
|
|
import { AnswersPanel } from 'web/components/answers/answers-panel'
|
|
|
|
import { fromPropz, usePropz } from 'web/hooks/use-propz'
|
2022-08-04 21:27:02 +00:00
|
|
|
import { Leaderboard } from 'web/components/leaderboard'
|
|
|
|
import { resolvedPayout } from 'common/calculate'
|
|
|
|
import { formatMoney } from 'common/util/format'
|
2022-05-09 13:04:36 +00:00
|
|
|
import { ContractTabs } from 'web/components/contract/contract-tabs'
|
|
|
|
import { useWindowSize } from 'web/hooks/use-window-size'
|
2022-04-28 23:01:50 +00:00
|
|
|
import Confetti from 'react-confetti'
|
2022-08-04 21:27:02 +00:00
|
|
|
import { NumericBetPanel } from 'web/components/numeric-bet-panel'
|
|
|
|
import { NumericResolutionPanel } from 'web/components/numeric-resolution-panel'
|
2022-05-20 00:34:08 +00:00
|
|
|
import { useIsIframe } from 'web/hooks/use-is-iframe'
|
|
|
|
import ContractEmbedPage from '../embed/[username]/[contractSlug]'
|
2022-06-10 17:23:27 +00:00
|
|
|
import { useBets } from 'web/hooks/use-bets'
|
2022-07-10 18:05:44 +00:00
|
|
|
import { CPMMBinaryContract } from 'common/contract'
|
2022-06-14 02:09:09 +00:00
|
|
|
import { AlertBox } from 'web/components/alert-box'
|
2022-06-15 21:34:34 +00:00
|
|
|
import { useTracking } from 'web/hooks/use-tracking'
|
2022-08-04 21:27:02 +00:00
|
|
|
import { CommentTipMap, useTipTxns } from 'web/hooks/use-tip-txns'
|
2022-06-27 00:00:02 +00:00
|
|
|
import { useLiquidity } from 'web/hooks/use-liquidity'
|
2022-07-21 19:43:10 +00:00
|
|
|
import { useSaveReferral } from 'web/hooks/use-save-referral'
|
2022-08-04 21:27:02 +00:00
|
|
|
import { getOpenGraphProps } from 'web/components/contract/contract-card-preview'
|
|
|
|
import { User } from 'common/user'
|
|
|
|
import { listUsers } from 'web/lib/firebase/users'
|
|
|
|
import { FeedComment } from 'web/components/feed/feed-comments'
|
|
|
|
import { Title } from 'web/components/title'
|
|
|
|
import { FeedBet } from 'web/components/feed/feed-bets'
|
2021-12-09 21:31:02 +00:00
|
|
|
|
2022-03-09 02:43:30 +00:00
|
|
|
export const getStaticProps = fromPropz(getStaticPropz)
|
|
|
|
export async function getStaticPropz(props: {
|
2022-01-21 23:21:46 +00:00
|
|
|
params: { username: string; contractSlug: string }
|
|
|
|
}) {
|
2021-12-19 05:50:47 +00:00
|
|
|
const { username, contractSlug } = props.params
|
|
|
|
const contract = (await getContractFromSlug(contractSlug)) || null
|
2022-01-15 00:16:25 +00:00
|
|
|
const contractId = contract?.id
|
|
|
|
|
2022-04-11 21:13:26 +00:00
|
|
|
const [bets, comments] = await Promise.all([
|
2022-02-01 18:06:42 +00:00
|
|
|
contractId ? listAllBets(contractId) : [],
|
|
|
|
contractId ? listAllComments(contractId) : [],
|
2022-01-15 00:16:25 +00:00
|
|
|
])
|
2021-12-09 22:05:55 +00:00
|
|
|
|
2021-12-16 03:24:11 +00:00
|
|
|
return {
|
|
|
|
props: {
|
2022-02-01 18:06:42 +00:00
|
|
|
contract,
|
2021-12-16 18:40:23 +00:00
|
|
|
username,
|
2021-12-19 05:50:47 +00:00
|
|
|
slug: contractSlug,
|
2022-07-14 19:57:17 +00:00
|
|
|
// Limit the data sent to the client. Client will still load all bets and comments directly.
|
|
|
|
bets: bets.slice(0, 5000),
|
|
|
|
comments: comments.slice(0, 1000),
|
2021-12-16 03:24:11 +00:00
|
|
|
},
|
2021-12-09 22:05:55 +00:00
|
|
|
|
2021-12-16 06:36:51 +00:00
|
|
|
revalidate: 60, // regenerate after a minute
|
2021-12-09 22:05:55 +00:00
|
|
|
}
|
2021-12-16 03:24:11 +00:00
|
|
|
}
|
2021-12-09 21:31:02 +00:00
|
|
|
|
2021-12-16 06:36:51 +00:00
|
|
|
export async function getStaticPaths() {
|
|
|
|
return { paths: [], fallback: 'blocking' }
|
|
|
|
}
|
2021-12-16 03:14:00 +00:00
|
|
|
|
2021-12-16 06:36:51 +00:00
|
|
|
export default function ContractPage(props: {
|
2021-12-16 18:21:16 +00:00
|
|
|
contract: Contract | null
|
2021-12-16 18:40:23 +00:00
|
|
|
username: string
|
2022-02-01 18:06:42 +00:00
|
|
|
bets: Bet[]
|
|
|
|
comments: Comment[]
|
|
|
|
slug: string
|
2022-04-11 21:13:26 +00:00
|
|
|
backToHome?: () => void
|
2021-12-16 06:36:51 +00:00
|
|
|
}) {
|
2022-03-09 02:43:30 +00:00
|
|
|
props = usePropz(props, getStaticPropz) ?? {
|
|
|
|
contract: null,
|
|
|
|
username: '',
|
|
|
|
comments: [],
|
|
|
|
bets: [],
|
|
|
|
slug: '',
|
|
|
|
}
|
2022-06-10 17:23:27 +00:00
|
|
|
|
|
|
|
const inIframe = useIsIframe()
|
|
|
|
if (inIframe) {
|
|
|
|
return <ContractEmbedPage {...props} />
|
|
|
|
}
|
|
|
|
|
2022-06-13 21:05:46 +00:00
|
|
|
const { contract } = props
|
|
|
|
|
2022-06-10 17:23:27 +00:00
|
|
|
if (!contract) {
|
|
|
|
return <Custom404 />
|
|
|
|
}
|
|
|
|
|
|
|
|
return <ContractPageContent {...{ ...props, contract }} />
|
2022-04-11 21:13:26 +00:00
|
|
|
}
|
|
|
|
|
2022-06-10 17:23:27 +00:00
|
|
|
export function ContractPageContent(
|
|
|
|
props: Parameters<typeof ContractPage>[0] & { contract: Contract }
|
|
|
|
) {
|
2022-06-13 21:05:46 +00:00
|
|
|
const { backToHome, comments } = props
|
|
|
|
|
|
|
|
const contract = useContractWithPreload(props.contract) ?? props.contract
|
2022-06-10 17:23:27 +00:00
|
|
|
|
2022-06-15 21:34:34 +00:00
|
|
|
useTracking('view market', {
|
|
|
|
slug: contract.slug,
|
|
|
|
contractId: contract.id,
|
|
|
|
creatorId: contract.creatorId,
|
|
|
|
})
|
|
|
|
|
2022-06-10 17:23:27 +00:00
|
|
|
const bets = useBets(contract.id) ?? props.bets
|
2022-06-27 00:00:02 +00:00
|
|
|
const liquidityProvisions =
|
|
|
|
useLiquidity(contract.id)?.filter((l) => !l.isAnte && l.amount > 0) ?? []
|
2022-06-10 17:23:27 +00:00
|
|
|
// Sort for now to see if bug is fixed.
|
|
|
|
comments.sort((c1, c2) => c1.createdTime - c2.createdTime)
|
2022-04-11 21:13:26 +00:00
|
|
|
|
2022-07-07 23:23:13 +00:00
|
|
|
const tips = useTipTxns({ contractId: contract.id })
|
2022-06-18 03:28:16 +00:00
|
|
|
|
2021-12-16 05:56:12 +00:00
|
|
|
const user = useUser()
|
2022-07-10 18:05:44 +00:00
|
|
|
|
2022-04-28 23:01:50 +00:00
|
|
|
const { width, height } = useWindowSize()
|
2021-12-09 22:05:55 +00:00
|
|
|
|
2022-04-28 23:01:50 +00:00
|
|
|
const [showConfetti, setShowConfetti] = useState(false)
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
const shouldSeeConfetti = !!(
|
|
|
|
user &&
|
|
|
|
contract.creatorId === user.id &&
|
|
|
|
Date.now() - contract.createdTime < 10 * 1000
|
|
|
|
)
|
|
|
|
setShowConfetti(shouldSeeConfetti)
|
|
|
|
}, [contract, user])
|
2022-02-06 22:55:14 +00:00
|
|
|
|
2022-05-19 17:42:03 +00:00
|
|
|
const { creatorId, isResolved, question, outcomeType } = contract
|
2022-02-17 23:00:19 +00:00
|
|
|
|
2021-12-14 06:12:25 +00:00
|
|
|
const isCreator = user?.id === creatorId
|
2022-02-17 23:00:19 +00:00
|
|
|
const isBinary = outcomeType === 'BINARY'
|
2022-07-02 19:37:59 +00:00
|
|
|
const isPseudoNumeric = outcomeType === 'PSEUDO_NUMERIC'
|
2022-05-19 17:42:03 +00:00
|
|
|
const isNumeric = outcomeType === 'NUMERIC'
|
2022-01-26 20:08:03 +00:00
|
|
|
const allowTrade = tradingAllowed(contract)
|
2022-01-10 16:32:54 +00:00
|
|
|
const allowResolve = !isResolved && isCreator && !!user
|
2022-07-02 19:37:59 +00:00
|
|
|
const hasSidePanel =
|
|
|
|
(isBinary || isNumeric || isPseudoNumeric) && (allowTrade || allowResolve)
|
2021-12-14 00:00:02 +00:00
|
|
|
|
2022-02-18 00:34:11 +00:00
|
|
|
const ogCardProps = getOpenGraphProps(contract)
|
2022-01-10 07:05:24 +00:00
|
|
|
|
2022-07-21 19:43:10 +00:00
|
|
|
useSaveReferral(user, {
|
2022-08-04 21:27:02 +00:00
|
|
|
defaultReferrerUsername: contract.creatorUsername,
|
2022-07-21 19:43:10 +00:00
|
|
|
contractId: contract.id,
|
|
|
|
})
|
2022-07-01 13:47:19 +00:00
|
|
|
|
2022-03-31 05:35:20 +00:00
|
|
|
const rightSidebar = hasSidePanel ? (
|
|
|
|
<Col className="gap-4">
|
2022-05-19 17:42:03 +00:00
|
|
|
{allowTrade &&
|
|
|
|
(isNumeric ? (
|
2022-06-01 02:42:35 +00:00
|
|
|
<NumericBetPanel className="hidden xl:flex" contract={contract} />
|
2022-05-19 17:42:03 +00:00
|
|
|
) : (
|
2022-07-10 18:05:44 +00:00
|
|
|
<BetPanel
|
|
|
|
className="hidden xl:flex"
|
|
|
|
contract={contract as CPMMBinaryContract}
|
|
|
|
/>
|
2022-05-19 17:42:03 +00:00
|
|
|
))}
|
|
|
|
{allowResolve &&
|
2022-07-02 19:37:59 +00:00
|
|
|
(isNumeric || isPseudoNumeric ? (
|
2022-06-01 02:42:35 +00:00
|
|
|
<NumericResolutionPanel creator={user} contract={contract} />
|
2022-05-19 17:42:03 +00:00
|
|
|
) : (
|
2022-06-01 02:42:35 +00:00
|
|
|
<ResolutionPanel creator={user} contract={contract} />
|
2022-05-19 17:42:03 +00:00
|
|
|
))}
|
2022-03-31 05:35:20 +00:00
|
|
|
</Col>
|
|
|
|
) : null
|
|
|
|
|
2021-12-09 22:05:55 +00:00
|
|
|
return (
|
2022-03-31 05:35:20 +00:00
|
|
|
<Page rightSidebar={rightSidebar}>
|
2022-04-28 23:01:50 +00:00
|
|
|
{showConfetti && (
|
|
|
|
<Confetti
|
|
|
|
width={width ? width : 500}
|
|
|
|
height={height ? height : 500}
|
|
|
|
recycle={false}
|
|
|
|
numberOfPieces={300}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
|
2022-02-17 23:00:19 +00:00
|
|
|
{ogCardProps && (
|
|
|
|
<SEO
|
|
|
|
title={question}
|
|
|
|
description={ogCardProps.description}
|
|
|
|
url={`/${props.username}/${props.slug}`}
|
|
|
|
ogCardProps={ogCardProps}
|
|
|
|
/>
|
|
|
|
)}
|
2021-12-16 03:14:00 +00:00
|
|
|
|
2022-05-23 22:09:40 +00:00
|
|
|
<Col className="w-full justify-between rounded border-0 border-gray-100 bg-white py-6 pl-1 pr-2 sm:px-2 md:px-6 md:py-8">
|
2022-04-11 21:13:26 +00:00
|
|
|
{backToHome && (
|
|
|
|
<button
|
|
|
|
className="btn btn-sm mb-4 items-center gap-2 self-start border-0 border-gray-700 bg-white normal-case text-gray-700 hover:bg-white hover:text-gray-700 lg:hidden"
|
|
|
|
onClick={backToHome}
|
|
|
|
>
|
|
|
|
<ArrowLeftIcon className="h-5 w-5 text-gray-700" />
|
|
|
|
Back
|
|
|
|
</button>
|
|
|
|
)}
|
|
|
|
|
2022-08-04 21:27:02 +00:00
|
|
|
<ContractOverview
|
|
|
|
contract={contract}
|
|
|
|
bets={bets.filter((b) => !b.challengeSlug)}
|
|
|
|
/>
|
2022-07-02 19:37:59 +00:00
|
|
|
|
2022-06-14 02:09:09 +00:00
|
|
|
{isNumeric && (
|
|
|
|
<AlertBox
|
|
|
|
title="Warning"
|
2022-07-02 19:37:59 +00:00
|
|
|
text="Distributional numeric markets were introduced as an experimental feature and are now deprecated."
|
2022-06-14 02:09:09 +00:00
|
|
|
/>
|
|
|
|
)}
|
2022-04-18 23:02:40 +00:00
|
|
|
|
2022-07-28 02:40:33 +00:00
|
|
|
{(outcomeType === 'FREE_RESPONSE' ||
|
|
|
|
outcomeType === 'MULTIPLE_CHOICE') && (
|
2022-05-03 21:54:00 +00:00
|
|
|
<>
|
|
|
|
<Spacer h={4} />
|
2022-06-01 02:42:35 +00:00
|
|
|
<AnswersPanel contract={contract} />
|
2022-05-03 21:54:00 +00:00
|
|
|
<Spacer h={4} />
|
|
|
|
</>
|
|
|
|
)}
|
2022-04-03 21:57:38 +00:00
|
|
|
|
2022-06-07 22:03:22 +00:00
|
|
|
{isNumeric && allowTrade && (
|
2022-06-01 02:42:35 +00:00
|
|
|
<NumericBetPanel className="xl:hidden" contract={contract} />
|
2022-05-19 17:42:03 +00:00
|
|
|
)}
|
|
|
|
|
2022-05-03 20:57:39 +00:00
|
|
|
{isResolved && (
|
2022-04-03 21:57:38 +00:00
|
|
|
<>
|
|
|
|
<div className="grid grid-cols-1 sm:grid-cols-2">
|
2022-05-10 21:22:57 +00:00
|
|
|
<ContractLeaderboard contract={contract} bets={bets} />
|
2022-04-03 21:57:38 +00:00
|
|
|
<ContractTopTrades
|
|
|
|
contract={contract}
|
|
|
|
bets={bets}
|
|
|
|
comments={comments}
|
2022-06-18 03:28:16 +00:00
|
|
|
tips={tips}
|
2022-04-03 21:57:38 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<Spacer h={12} />
|
|
|
|
</>
|
|
|
|
)}
|
2022-04-08 21:13:10 +00:00
|
|
|
|
|
|
|
<ContractTabs
|
|
|
|
contract={contract}
|
|
|
|
user={user}
|
2022-06-27 00:00:02 +00:00
|
|
|
liquidityProvisions={liquidityProvisions}
|
2022-04-08 21:13:10 +00:00
|
|
|
bets={bets}
|
2022-06-18 03:28:16 +00:00
|
|
|
tips={tips}
|
2022-04-08 21:13:10 +00:00
|
|
|
comments={comments}
|
|
|
|
/>
|
2021-12-12 22:14:52 +00:00
|
|
|
</Col>
|
2021-12-20 04:06:30 +00:00
|
|
|
</Page>
|
2021-12-09 22:05:55 +00:00
|
|
|
)
|
|
|
|
}
|
2021-12-16 04:30:24 +00:00
|
|
|
|
2022-08-04 21:27:02 +00:00
|
|
|
function ContractLeaderboard(props: { contract: Contract; bets: Bet[] }) {
|
|
|
|
const { contract, bets } = props
|
|
|
|
const [users, setUsers] = useState<User[]>()
|
2022-02-17 23:00:19 +00:00
|
|
|
|
2022-08-04 21:27:02 +00:00
|
|
|
const { userProfits, top5Ids } = useMemo(() => {
|
|
|
|
// Create a map of userIds to total profits (including sales)
|
|
|
|
const openBets = bets.filter((bet) => !bet.isSold && !bet.sale)
|
|
|
|
const betsByUser = groupBy(openBets, 'userId')
|
|
|
|
|
|
|
|
const userProfits = mapValues(betsByUser, (bets) =>
|
|
|
|
sumBy(bets, (bet) => resolvedPayout(contract, bet) - bet.amount)
|
|
|
|
)
|
|
|
|
// Find the 5 users with the most profits
|
|
|
|
const top5Ids = Object.entries(userProfits)
|
|
|
|
.sort(([_i1, p1], [_i2, p2]) => p2 - p1)
|
|
|
|
.filter(([, p]) => p > 0)
|
|
|
|
.slice(0, 5)
|
|
|
|
.map(([id]) => id)
|
|
|
|
return { userProfits, top5Ids }
|
|
|
|
}, [contract, bets])
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (top5Ids.length > 0) {
|
|
|
|
listUsers(top5Ids).then((users) => {
|
|
|
|
const sortedUsers = sortBy(users, (user) => -userProfits[user.id])
|
|
|
|
setUsers(sortedUsers)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}, [userProfits, top5Ids])
|
|
|
|
|
|
|
|
return users && users.length > 0 ? (
|
|
|
|
<Leaderboard
|
|
|
|
title="🏅 Top bettors"
|
|
|
|
users={users || []}
|
|
|
|
columns={[
|
|
|
|
{
|
|
|
|
header: 'Total profit',
|
|
|
|
renderCell: (user) => formatMoney(userProfits[user.id] || 0),
|
|
|
|
},
|
|
|
|
]}
|
|
|
|
className="mt-12 max-w-sm"
|
|
|
|
/>
|
|
|
|
) : null
|
|
|
|
}
|
|
|
|
|
|
|
|
function ContractTopTrades(props: {
|
|
|
|
contract: Contract
|
|
|
|
bets: Bet[]
|
|
|
|
comments: Comment[]
|
|
|
|
tips: CommentTipMap
|
|
|
|
}) {
|
|
|
|
const { contract, bets, comments, tips } = props
|
|
|
|
const commentsById = keyBy(comments, 'id')
|
|
|
|
const betsById = keyBy(bets, 'id')
|
|
|
|
|
|
|
|
// If 'id2' is the sale of 'id1', both are logged with (id2 - id1) of profit
|
|
|
|
// Otherwise, we record the profit at resolution time
|
|
|
|
const profitById: Record<string, number> = {}
|
|
|
|
for (const bet of bets) {
|
|
|
|
if (bet.sale) {
|
|
|
|
const originalBet = betsById[bet.sale.betId]
|
|
|
|
const profit = bet.sale.amount - originalBet.amount
|
|
|
|
profitById[bet.id] = profit
|
|
|
|
profitById[originalBet.id] = profit
|
|
|
|
} else {
|
|
|
|
profitById[bet.id] = resolvedPayout(contract, bet) - bet.amount
|
|
|
|
}
|
2022-02-17 23:00:19 +00:00
|
|
|
}
|
2022-08-04 21:27:02 +00:00
|
|
|
|
|
|
|
// Now find the betId with the highest profit
|
|
|
|
const topBetId = sortBy(bets, (b) => -profitById[b.id])[0]?.id
|
|
|
|
const topBettor = useUserById(betsById[topBetId]?.userId)
|
|
|
|
|
|
|
|
// And also the commentId of the comment with the highest profit
|
|
|
|
const topCommentId = sortBy(
|
|
|
|
comments,
|
|
|
|
(c) => c.betId && -profitById[c.betId]
|
|
|
|
)[0]?.id
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="mt-12 max-w-sm">
|
|
|
|
{topCommentId && profitById[topCommentId] > 0 && (
|
|
|
|
<>
|
|
|
|
<Title text="💬 Proven correct" className="!mt-0" />
|
|
|
|
<div className="relative flex items-start space-x-3 rounded-md bg-gray-50 px-2 py-4">
|
|
|
|
<FeedComment
|
|
|
|
contract={contract}
|
|
|
|
comment={commentsById[topCommentId]}
|
|
|
|
tips={tips[topCommentId]}
|
|
|
|
betsBySameUser={[betsById[topCommentId]]}
|
2022-08-04 23:49:59 +00:00
|
|
|
truncate={false}
|
2022-08-04 21:27:02 +00:00
|
|
|
smallAvatar={false}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div className="mt-2 text-sm text-gray-500">
|
|
|
|
{commentsById[topCommentId].userName} made{' '}
|
|
|
|
{formatMoney(profitById[topCommentId] || 0)}!
|
|
|
|
</div>
|
|
|
|
<Spacer h={16} />
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
|
|
|
|
{/* If they're the same, only show the comment; otherwise show both */}
|
|
|
|
{topBettor && topBetId !== topCommentId && profitById[topBetId] > 0 && (
|
|
|
|
<>
|
|
|
|
<Title text="💸 Smartest money" className="!mt-0" />
|
|
|
|
<div className="relative flex items-start space-x-3 rounded-md bg-gray-50 px-2 py-4">
|
|
|
|
<FeedBet
|
|
|
|
contract={contract}
|
|
|
|
bet={betsById[topBetId]}
|
|
|
|
hideOutcome={false}
|
|
|
|
smallAvatar={false}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div className="mt-2 text-sm text-gray-500">
|
|
|
|
{topBettor?.name} made {formatMoney(profitById[topBetId] || 0)}!
|
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
)
|
2022-02-17 23:00:19 +00:00
|
|
|
}
|