import { observer } from "mobx-react"; // components import { MultipleSelectGroupAction } from "@/components/core"; import { IBlockUpdateData, IGanttBlock } from "@/components/gantt-chart"; // helpers import { cn } from "@/helpers/common.helper"; // hooks import { TSelectionHelper } from "@/hooks/use-multiple-select"; // constants import { GANTT_SELECT_GROUP, HEADER_HEIGHT, SIDEBAR_WIDTH } from "../constants"; type Props = { blocks: IGanttBlock[] | null; blockUpdateHandler: (block: any, payload: IBlockUpdateData) => void; enableReorder: boolean; enableSelection: boolean; sidebarToRender: (props: any) => React.ReactNode; title: string; quickAdd?: React.JSX.Element | undefined; selectionHelpers: TSelectionHelper; }; export const GanttChartSidebar: React.FC = observer((props) => { const { blocks, blockUpdateHandler, enableReorder, enableSelection, sidebarToRender, title, quickAdd, selectionHelpers, } = props; const isGroupSelectionEmpty = selectionHelpers.isGroupSelected(GANTT_SELECT_GROUP) === "empty"; return (
{enableSelection && (
)}
{title}
Duration
{sidebarToRender?.({ title, blockUpdateHandler, blocks, enableReorder, enableSelection, selectionHelpers })}
{quickAdd ? quickAdd : null}
); });