asi-calculator/components/FormAmount/FormAmount.tsx

27 lines
678 B
TypeScript
Raw Normal View History

2024-03-30 20:50:51 +01:00
import { InputAmount } from '@/components/FormAmount/Inputs/InputAmount'
import { InputToken } from './Inputs/InputToken'
2024-03-29 22:54:07 +01:00
import styles from './FormAmount.module.css'
2024-03-30 20:50:51 +01:00
import { Dispatch, SetStateAction } from 'react'
import { Token } from './types'
2024-03-29 22:54:07 +01:00
export function FormAmount({
amount,
2024-03-30 20:50:51 +01:00
setAmount,
token,
setToken,
isFiat
2024-03-29 22:54:07 +01:00
}: {
amount: number
2024-03-30 20:50:51 +01:00
setAmount: Dispatch<SetStateAction<number>>
token: Token
setToken?: Dispatch<SetStateAction<Token>>
isFiat?: boolean
2024-03-29 22:54:07 +01:00
}) {
return (
<form className={styles.form}>
2024-03-30 20:50:51 +01:00
<InputAmount amount={amount} setAmount={setAmount} />
<InputToken token={token} setToken={setToken} isFiat={isFiat} />
2024-03-29 22:54:07 +01:00
</form>
)
}