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 = { blockIds: string[]; fullScreenMode: boolean; handleChartView: (view: TGanttViews) => void; handleToday: () => void; loaderTitle: string; title: string; toggleFullScreenMode: () => void; }; export const GanttChartHeader: React.FC = observer((props) => { const { blockIds, fullScreenMode, handleChartView, handleToday, loaderTitle, title, toggleFullScreenMode } = props; // chart hook const { currentView } = useGanttChart(); return (
{title}
{blockIds ? `${blockIds.length} ${loaderTitle}` : "Loading..."}
{VIEWS_LIST.map((chartView: any) => (
handleChartView(chartView?.key)} > {chartView?.title}
))}
); });