import { FC } from "react"; import { useRouter } from "next/router"; // components import { GanttChartRoot } from "components/gantt-chart"; // hooks import useGanttChartModuleIssues from "hooks/gantt-chart/module-issues-view"; type Props = {}; export const ModuleIssuesGanttChartView: FC = ({}) => { const router = useRouter(); const { workspaceSlug, projectId, moduleId } = router.query; const { ganttIssues, mutateGanttIssues } = useGanttChartModuleIssues( workspaceSlug as string, projectId as string, moduleId as string ); // rendering issues on gantt sidebar const GanttSidebarBlockView = ({ data }: any) => (
{data?.name}
); // rendering issues on gantt card const GanttBlockView = ({ data }: any) => (
{data?.name}
); // 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) => { if (_block?.start_date && _block.target_date) console.log("_block", _block); return { start_date: new Date(_block.created_at), target_date: new Date(_block.updated_at), data: _block, }; }) : []; return (
} blockRender={(data: any) => } />
); };