asi-calculator/components/FormAmount/FormAmount.tsx

27 lines
687 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>>
2024-03-31 05:32:11 +02:00
token: Token | string
2024-03-30 20:50:51 +01:00
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>
)
}