asi-calculator/components/FormAmount/Inputs/InputAmount.tsx

22 lines
433 B
TypeScript
Raw Normal View History

2024-03-30 20:50:51 +01:00
import { Dispatch, SetStateAction } from 'react'
import styles from './InputAmount.module.css'
export function InputAmount({
amount,
setAmount
}: {
amount: number
setAmount: Dispatch<SetStateAction<number>>
}) {
return (
<input
className={styles.input}
type="text"
2024-03-30 23:12:29 +01:00
inputMode="numeric"
pattern="[0-9]*"
2024-03-30 20:50:51 +01:00
value={amount}
onChange={(e) => setAmount(Number(e.target.value))}
/>
)
}