import { observer } from "mobx-react"; import { Expand, Shrink } from "lucide-react"; // hooks // helpers import { VIEWS_LIST } from "components/gantt-chart/data"; import { cn } from "helpers/common.helper"; // types import { useGanttChart } from "../hooks/use-gantt-chart"; import { IGanttBlock, TGanttViews } from "../types"; // constants type Props = { blocks: IGanttBlock[] | null; fullScreenMode: boolean; handleChartView: (view: TGanttViews) => void; handleToday: () => void; loaderTitle: string; title: string; toggleFullScreenMode: () => void; }; export const GanttChartHeader: React.FC = observer((props) => { const { blocks, fullScreenMode, handleChartView, handleToday, loaderTitle, title, toggleFullScreenMode } = props; // chart hook const { currentView } = useGanttChart(); return (
{title}
{blocks ? `${blocks.length} ${loaderTitle}` : "Loading..."}
{VIEWS_LIST.map((chartView: any) => (
handleChartView(chartView?.key)} > {chartView?.title}
))}
); });