import React, { useState } from "react"; // headless ui import { Dialog, Transition } from "@headlessui/react"; import { FullScreenPeekView, SidePeekView } from "components/issues/peek-overview"; // types import type { IIssue } from "store/types"; type Props = { issue: IIssue | null; isOpen: boolean; onClose: () => void; workspaceSlug: string; }; export type TPeekOverviewModes = "side" | "modal" | "full"; export const IssuePeekOverview: React.FC = ({ issue, isOpen, onClose, workspaceSlug, }) => { const [peekOverviewMode, setPeekOverviewMode] = useState("side"); const handleClose = () => { onClose(); setPeekOverviewMode("side"); }; if (!issue || !isOpen) return null; return ( {/* add backdrop conditionally */} {(peekOverviewMode === "modal" || peekOverviewMode === "full") && (
)}
{(peekOverviewMode === "side" || peekOverviewMode === "modal") && ( setPeekOverviewMode(mode)} workspaceSlug={workspaceSlug} /> )} {peekOverviewMode === "full" && ( setPeekOverviewMode(mode)} /> )}
); };