import { useRouter } from "next/router";
// ui
import { Tooltip, ContrastIcon } from "@plane/ui";
// helpers
import { getDateRangeStatus, renderShortDate } from "helpers/date-time.helper";
// types
import { ICycle } from "types";
export const CycleGanttBlock = ({ data }: { data: ICycle }) => {
const router = useRouter();
const { workspaceSlug } = router.query;
const cycleStatus = getDateRangeStatus(data?.start_date, data?.end_date);
return (
router.push(`/${workspaceSlug}/projects/${data?.project}/cycles/${data?.id}`)}
>
{data?.name}
{renderShortDate(data?.start_date ?? "")} to {renderShortDate(data?.end_date ?? "")}
}
position="top-left"
>
{data?.name}
);
};
export const CycleGanttSidebarBlock = ({ data }: { data: ICycle }) => {
const router = useRouter();
const { workspaceSlug } = router.query;
const cycleStatus = getDateRangeStatus(data?.start_date, data?.end_date);
return (
router.push(`/${workspaceSlug}/projects/${data?.project}/cycles/${data?.id}`)}
>
{data?.name}
);
};