import { FC } from "react"; // next imports import Link from "next/link"; import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; // ui import { Tooltip } from "components/ui"; // hooks import useGanttChartViewIssues from "hooks/gantt-chart/view-issues-view"; type Props = {}; export const ViewIssuesGanttChartView: FC = ({}) => { const router = useRouter(); const { workspaceSlug, projectId, viewId } = router.query; const { ganttIssues, mutateGanttIssues } = useGanttChartViewIssues( workspaceSlug as string, projectId as string, viewId as string ); // rendering issues on gantt sidebar const GanttSidebarBlockView = ({ data }: any) => (
{data?.name}
); // rendering issues on gantt card const GanttBlockView = ({ data }: any) => (
{data?.name}
{data.infoToggle && (
info
)}
); // handle gantt issue start date and target date const handleUpdateDates = async (data: any) => { const payload = { id: data?.id, start_date: data?.start_date, target_date: data?.target_date, }; console.log("payload", payload); }; const blockFormat = (blocks: any) => blocks && blocks.length > 0 ? blocks.map((_block: any) => { let startDate = new Date(_block.created_at); let targetDate = new Date(_block.updated_at); let infoToggle = true; if (_block?.start_date && _block.target_date) { startDate = _block?.start_date; targetDate = _block.target_date; infoToggle = false; } return { start_date: new Date(startDate), target_date: new Date(targetDate), infoToggle: infoToggle, data: _block, }; }) : []; return (
} blockRender={(data: any) => } />
); };