// hooks import { Expand, Shrink } from "lucide-react"; import { useChart } from "../hooks"; // types import { IGanttBlock, TGanttViews } from "../types"; import { IMonthBlock } from "../views"; import { ScrollSyncPane } from "react-scroll-sync"; type Props = { blocks: IGanttBlock[] | null; fullScreenMode: boolean; handleChartView: (view: TGanttViews) => void; handleToday: () => void; loaderTitle: string; title: string; toggleFullScreenMode: () => void; }; export const GanttChartHeader: React.FC = (props) => { const { blocks, fullScreenMode, handleChartView, handleToday, loaderTitle, title, toggleFullScreenMode } = props; // chart hook const { currentView, currentViewData, allViews, renderView } = useChart(); const monthBlocks: IMonthBlock[] = renderView; return ( <>
{title}
{blocks ? `${blocks.length} ${loaderTitle}` : "Loading..."}
{allViews && allViews.map((_chatView: any) => (
handleChartView(_chatView?.key)} > {_chatView?.title}
))}
{monthBlocks?.map((block, rootIndex) => (
{block?.title}
{block?.children?.map((monthDay, _idx) => (
{monthDay.dayData.shortTitle[0]}{" "} {monthDay.day}
))}
{/*
{block?.children?.map((monthDay, index) => (
))}
*/}
))}
); };