import React, { useState } from 'react' import { Contract } from '../lib/firebase/contracts' import { Button } from './button' import { Col } from './layout/col' import { Spacer } from './layout/spacer' import { YesNoSelector } from './yes-no-selector' export function BetPanel(props: { contract: Contract; className?: string }) { const { contract, className } = props const [betChoice, setBetChoice] = useState<'yes' | 'no'>('yes') const [shares, setShares] = useState(0) return (
Pick outcome
Shares
setShares(parseInt(e.target.value) || 0)} onFocus={(e) => e.target.select()} />
Price
{shares * (betChoice === 'yes' ? 57 : 43)} points
{shares !== 0 && ( )} ) }