/* This example requires Tailwind CSS v2.0+ */ 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' import clsx from 'clsx' // Inline version of a bet panel. Opens BetPanel in a new modal. export default function BetRow(props: { contract: Contract className?: string }) { const [open, setOpen] = useState(false) const [betChoice, setBetChoice] = useState<'YES' | 'NO' | undefined>( undefined ) return ( <>
{ setOpen(true) setBetChoice(choice) }} />
) } // 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}
) }