import { useRouter } from "next/router"; // ui import { Tooltip, StateGroupIcon } from "@plane/ui"; // helpers import { renderShortDate } from "helpers/date-time.helper"; // types import { IIssue } from "types"; export const IssueGanttBlock = ({ data }: { data: IIssue }) => { const router = useRouter(); const handleIssuePeekOverview = (event: React.MouseEvent) => { const { query } = router; if (event.ctrlKey || event.metaKey) { const issueUrl = `/${data?.workspace_detail.slug}/projects/${data?.project_detail.id}/issues/${data?.id}`; window.open(issueUrl, "_blank"); // Open link in a new tab } else { router.push({ pathname: router.pathname, query: { ...query, peekIssueId: data?.id, peekProjectId: data?.project }, }); } }; return (
{data?.name}
{renderShortDate(data?.start_date ?? "")} to {renderShortDate(data?.target_date ?? "")}
} position="top-left" >
{data?.name}
); }; // rendering issues on gantt sidebar export const IssueGanttSidebarBlock = ({ data }: { data: IIssue }) => { const router = useRouter(); const handleIssuePeekOverview = () => { const { query } = router; router.push({ pathname: router.pathname, query: { ...query, peekIssueId: data?.id, peekProjectId: data?.project }, }); }; return (
{data?.project_detail?.identifier} {data?.sequence_id}
{data?.name}
); };