2022-10-10 02:37:24 +00:00
|
|
|
import { Input } from './input'
|
2022-01-30 21:51:30 +00:00
|
|
|
|
|
|
|
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-10-13 18:23:42 +00:00
|
|
|
<label className="flex items-center text-lg">
|
|
|
|
<Input
|
|
|
|
type="number"
|
|
|
|
value={probabilityInt}
|
|
|
|
className="input-md w-28 !text-lg"
|
|
|
|
disabled={isSubmitting}
|
|
|
|
min={1}
|
|
|
|
max={99}
|
|
|
|
onChange={(e) =>
|
|
|
|
setProbabilityInt(parseInt(e.target.value.substring(0, 2)))
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
<span>%</span>
|
|
|
|
</label>
|
2022-01-30 21:51:30 +00:00
|
|
|
)
|
|
|
|
}
|