import clsx from 'clsx' import { Fragment, useState } from 'react' import { Dialog, Transition } from '@headlessui/react' import { Contract } from '../lib/firebase/contracts' import { BetPanel } from './bet-panel' import { Row } from './layout/row' import { YesNoSelector } from './yes-no-selector' // Inline version of a bet panel. Opens BetPanel in a new modal. export default function BetRow(props: { contract: Contract className?: string labelClassName?: string }) { const { className, labelClassName } = props const [open, setOpen] = useState(false) const [betChoice, setBetChoice] = useState<'YES' | 'NO' | undefined>( undefined ) return ( <>
Place a trade
{ setOpen(true) setBetChoice(choice) }} />
setOpen(false)} />
) } // From https://tailwindui.com/components/application-ui/overlays/modals export function Modal(props: { children: React.ReactNode open: boolean setOpen: (open: boolean) => void }) { const { children, open, setOpen } = props return (
{/* This element is to trick the browser into centering the modal contents. */}
{children}
) }