diff --git a/web/pages/[username]/[contractSlug].tsx b/web/pages/[username]/[contractSlug].tsx index 60a1a5fb..4fe92741 100644 --- a/web/pages/[username]/[contractSlug].tsx +++ b/web/pages/[username]/[contractSlug].tsx @@ -11,7 +11,11 @@ import { useBets } from '../../hooks/use-bets' import { Title } from '../../components/title' import { Spacer } from '../../components/layout/spacer' import { User } from '../../lib/firebase/users' -import { Contract, getContractFromSlug } from '../../lib/firebase/contracts' +import { + compute, + Contract, + getContractFromSlug, +} from '../../lib/firebase/contracts' import { SEO } from '../../components/SEO' import { Page } from '../../components/page' @@ -47,13 +51,18 @@ export default function ContractPage(props: { return
Contract not found...
} - const { creatorId, isResolved } = contract + const { creatorId, isResolved, resolution, question } = contract const isCreator = user?.id === creatorId + const { probPercent } = compute(contract) + const title = resolution + ? `Resolved ${resolution}: ${question}` + : `${probPercent} chance: ${question}` + return (