import { FC, useEffect, useState } from "react"; // helpers import { ChartDraggable } from "../helpers/draggable"; // data import { datePreview } from "../data"; export const GanttChartBlocks: FC<{ itemsContainerWidth: number; blocks: null | any[]; sidebarBlockRender: FC; blockRender: FC; }> = ({ itemsContainerWidth, blocks, sidebarBlockRender, blockRender }) => { const handleChartBlockPosition = (block: any) => { // setChartBlocks((prevData: any) => // prevData.map((_block: any) => (_block?.data?.id == block?.data?.id ? block : _block)) // ); }; return (
{blocks && blocks.length > 0 && blocks.map((block: any, _idx: number) => ( <> {block.start_date && block.target_date && (
{block?.start_date ? datePreview(block?.start_date, true) : "-"}
{blockRender({ ...block?.data })}
{block?.target_date ? datePreview(block?.target_date, true) : "-"}
)} ))}
{/* sidebar */} {/*
{blocks && blocks.length > 0 && blocks.map((block: any, _idx: number) => (
{sidebarBlockRender(block?.data)}
))}
*/}
); };