import { Dispatch, SetStateAction } from 'react' import { TokenSymbol } from '@/types' import { Select, Input, FormInline } from '@/components' export function FormAmount({ amount, setAmount, token, setToken, isFiat }: { amount: number setAmount: Dispatch> token: TokenSymbol | string setToken?: Dispatch> isFiat?: boolean }) { function handleAmountChange(e: React.ChangeEvent) { const { value } = e.target if (value === '') { setAmount(0) } else if (isNaN(Number(value))) { return } else { setAmount(Number(value)) } } function handleTokenChange(e: React.ChangeEvent) { if (!setToken) return setToken(e.target.value as TokenSymbol) } function handleFocus(e: React.FocusEvent) { e.target.select() } const options = isFiat ? [{ value: 'USD', label: 'USD' }] : [ { value: 'OCEAN', label: 'OCEAN' }, { value: 'FET', label: 'FET' }, { value: 'AGIX', label: 'AGIX' } ] return (