import Link from "next/link"; // hooks import useToast from "hooks/use-toast"; // ui import { CustomSelect } from "components/ui"; // icons import { FullScreenPeekIcon, ModalPeekIcon, SidePeekIcon } from "@plane/ui"; import { LinkIcon, MoveRight, Trash2 } from "lucide-react"; // helpers import { copyTextToClipboard } from "helpers/string.helper"; // types import { IIssue } from "types"; import { TPeekOverviewModes } from "./layout"; type Props = { handleClose: () => void; handleDeleteIssue: () => void; issue: IIssue | undefined; mode: TPeekOverviewModes; setMode: (mode: TPeekOverviewModes) => void; workspaceSlug: string; }; const peekModes: { key: TPeekOverviewModes; icon: any; label: string; }[] = [ { key: "side", icon: SidePeekIcon, label: "Side Peek" }, { key: "modal", icon: ModalPeekIcon, label: "Modal Peek", }, { key: "full", icon: FullScreenPeekIcon, label: "Full Screen Peek", }, ]; export const PeekOverviewHeader: React.FC = ({ issue, handleClose, handleDeleteIssue, mode, setMode, workspaceSlug, }) => { const { setToastAlert } = useToast(); const handleCopyLink = () => { const urlToCopy = window.location.href; copyTextToClipboard(urlToCopy).then(() => { setToastAlert({ type: "success", title: "Link copied!", message: "Issue link copied to clipboard", }); }); }; const currentMode = peekModes.find((m) => m.key === mode); return (
{mode === "side" && ( )} setMode(val)} customButton={ } > {peekModes.map((mode) => (
{mode.label}
))}
{(mode === "side" || mode === "modal") && (
)}
); };