mirror of
https://github.com/kremalicious/asi-calculator.git
synced 2024-12-23 01:39:40 +01:00
32 lines
851 B
TypeScript
32 lines
851 B
TypeScript
'use client'
|
|
|
|
import stylesShared from '../styles.module.css'
|
|
import { useState } from 'react'
|
|
import { useDebounce } from 'use-debounce'
|
|
import { FormAmount } from '@/components/FormAmount'
|
|
import { SwapResults } from './Results'
|
|
import { TokenSymbol } from '@/types'
|
|
|
|
export function Swap() {
|
|
const [amount, setAmount] = useState(100)
|
|
const [debouncedAmount] = useDebounce(amount, 500)
|
|
const [token, setToken] = useState<TokenSymbol>('OCEAN')
|
|
|
|
return (
|
|
<div className={stylesShared.results}>
|
|
<h3 className={stylesShared.title}>
|
|
Holding or swapping{' '}
|
|
<FormAmount
|
|
amount={amount}
|
|
token={token}
|
|
setAmount={setAmount}
|
|
// setToken={setToken}
|
|
/>{' '}
|
|
right now gets you:
|
|
</h3>
|
|
|
|
<SwapResults token={token} amount={debouncedAmount} />
|
|
</div>
|
|
)
|
|
}
|