/* This example requires Tailwind CSS v2.0+ */ import react from "react"; import { Fragment, useRef, useState } from "react"; import { Dialog, Transition } from "@headlessui/react"; import { PuzzleIcon } from "@heroicons/react/outline"; import { XIcon } from "@heroicons/react/solid"; export default function Modal({ title, img, closePopHandler, children }) { const [open, setOpen] = useState(true); const [imgUrl, setImgUrl] = react.useState(img); const cancelButtonRef = useRef(null); return (
{/* This element is to trick the browser into centering the modal contents. */}
{/*
{!imgUrl ?
*/}
{ setOpen(false); closePopHandler(); }} ref={cancelButtonRef} aria-hidden="true" > {title}
); }