// hooks import useToast from "hooks/use-toast"; // ui import { Icon } from "components/ui"; // helpers import { copyTextToClipboard } from "helpers/string.helper"; // types import { TPeekOverviewModes } from "./layout"; import { ArrowRightAlt, CloseFullscreen, East, OpenInFull } from "@mui/icons-material"; type Props = { handleClose: () => void; issue: any; mode: TPeekOverviewModes; setMode: (mode: TPeekOverviewModes) => void; workspaceSlug: string; }; const peekModes: { key: TPeekOverviewModes; icon: string; label: string; }[] = [ { key: "side", icon: "side_navigation", label: "Side Peek" }, { key: "modal", icon: "dialogs", label: "Modal Peek", }, { key: "full", icon: "nearby", label: "Full Screen Peek", }, ]; export const PeekOverviewHeader: React.FC = ({ issue, handleClose, mode, setMode, workspaceSlug }) => { const { setToastAlert } = useToast(); const handleCopyLink = () => { const originURL = typeof window !== "undefined" && window.location.origin ? window.location.origin : ""; copyTextToClipboard(`${originURL}/${workspaceSlug}/projects/${issue.project}/`).then(() => { setToastAlert({ type: "success", title: "Link copied!", message: "Issue link copied to clipboard", }); }); }; return (
{mode === "side" && ( )} {mode === "modal" || mode === "full" ? ( ) : ( )}
{(mode === "side" || mode === "modal") && (
)}
); };