2022-10-10 02:37:24 +00:00
|
|
|
import { Input } from './input'
|
2022-01-30 21:51:30 +00:00
|
|
|
import { Row } from './layout/row'
|
|
|
|
|
|
|
|
export function ProbabilitySelector(props: {
|
|
|
|
probabilityInt: number
|
|
|
|
setProbabilityInt: (p: number) => void
|
|
|
|
isSubmitting?: boolean
|
|
|
|
}) {
|
2022-04-30 17:05:43 +00:00
|
|
|
const { probabilityInt, setProbabilityInt, isSubmitting } = props
|
2022-01-30 21:51:30 +00:00
|
|
|
|
|
|
|
return (
|
2022-09-30 14:48:33 +00:00
|
|
|
<Row className="items-center gap-2">
|
|
|
|
<label className="input-group input-group-lg text-lg">
|
2022-10-10 02:37:24 +00:00
|
|
|
<Input
|
2022-01-30 21:51:30 +00:00
|
|
|
type="number"
|
|
|
|
value={probabilityInt}
|
2022-10-10 02:37:24 +00:00
|
|
|
className="input-md w-28 !text-lg"
|
2022-01-30 21:51:30 +00:00
|
|
|
disabled={isSubmitting}
|
2022-04-30 17:05:43 +00:00
|
|
|
min={1}
|
|
|
|
max={99}
|
2022-01-30 21:51:30 +00:00
|
|
|
onChange={(e) =>
|
|
|
|
setProbabilityInt(parseInt(e.target.value.substring(0, 2)))
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
<span>%</span>
|
|
|
|
</label>
|
|
|
|
</Row>
|
|
|
|
)
|
|
|
|
}
|