546b0231e7
* un-daisy labels * un-daisy inputs * un-daisy input groups * fixup input * un-daisy selects * un-daisy slider * Uninstall daisy. Migrate colors * un-daisy tables * fix input error styling * lint
27 lines
632 B
TypeScript
27 lines
632 B
TypeScript
import { Input } from './input'
|
|
|
|
export function ProbabilitySelector(props: {
|
|
probabilityInt: number
|
|
setProbabilityInt: (p: number) => void
|
|
isSubmitting?: boolean
|
|
}) {
|
|
const { probabilityInt, setProbabilityInt, isSubmitting } = props
|
|
|
|
return (
|
|
<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>
|
|
)
|
|
}
|