import clsx from 'clsx' import { useEffect, useState } from 'react' import { useUser } from 'web/hooks/use-user' import { checkoutURL } from 'web/lib/service/stripe' import { FundsSelector } from './yes-no-selector' export function AddFundsButton(props: { className?: string }) { const { className } = props const user = useUser() const [amountSelected, setAmountSelected] = useState<1000 | 2500 | 10000>( 2500 ) const location = useLocation() return ( <>
Get Manifold Dollars
Use Manifold Dollars to trade in your favorite markets.
(Not redeemable for cash.)
Amount
Price USD
${Math.round(amountSelected / 100)}.00
) } // needed in next js // window not loaded at runtime const useLocation = () => { const [href, setHref] = useState('') useEffect(() => { setHref(window.location.href) }, []) return href }