diff --git a/web/pages/simulator/index.tsx b/web/pages/simulator/index.tsx index a94d9626..eda62127 100644 --- a/web/pages/simulator/index.tsx +++ b/web/pages/simulator/index.tsx @@ -11,10 +11,11 @@ import { } from 'chart.js' import { ChartData } from 'chart.js' import { Line } from 'react-chartjs-2' -import { bids } from './sample-bids' +import { bids as sampleBids } from './sample-bids' import { Entry, makeEntries } from './entries' // Auto import doesn't work for some reason... +// So we manually register ChartJS components instead: Chart.register( CategoryScale, LinearScale, @@ -110,14 +111,90 @@ function toRowEnd(entry: Entry) { } } +function newBidTable( + steps: number, + newBid: number, + setNewBid: (newBid: number) => void, + submitBid: () => void +) { + return ( +
Order # | +Type | +Bid | +Weight | +Probability | +Payout | +Return | ++ |
---|---|---|---|---|---|---|---|
{steps + 1} | +
+
+ YES
+
+ +
+ NO
+
+ |
+ + setNewBid(parseInt(e.target.value) || 0)} + onKeyUp={(e) => { + if (e.key === 'Enter') { + submitBid() + } + }} + onFocus={(e) => e.target.select()} + /> + | + {/*+ + | +