11"use client" ;
22
3+ import { observer } from "mobx-react" ;
34// ui
45import { Loader } from "@plane/ui" ;
56// components
6- import { ChartDataType , IBlockUpdateData , IGanttBlock } from "@/components/gantt-chart" ;
7+ import { IBlockUpdateData } from "@/components/gantt-chart" ;
8+ // hooks
9+ import { useTimeLineChart } from "@/hooks/use-timeline-chart" ;
10+ //
11+ import { ETimeLineTypeType } from "../../contexts" ;
712import { GanttDnDHOC } from "../gantt-dnd-HOC" ;
813import { handleOrderChange } from "../utils" ;
914import { ModulesSidebarBlock } from "./block" ;
@@ -12,13 +17,14 @@ import { ModulesSidebarBlock } from "./block";
1217type Props = {
1318 title : string ;
1419 blockUpdateHandler : ( block : any , payload : IBlockUpdateData ) => void ;
15- getBlockById : ( id : string , currentViewData ?: ChartDataType | undefined ) => IGanttBlock ;
1620 blockIds : string [ ] ;
1721 enableReorder : boolean ;
1822} ;
1923
20- export const ModuleGanttSidebar : React . FC < Props > = ( props ) => {
21- const { blockUpdateHandler, blockIds, getBlockById, enableReorder } = props ;
24+ export const ModuleGanttSidebar : React . FC < Props > = observer ( ( props ) => {
25+ const { blockUpdateHandler, blockIds, enableReorder } = props ;
26+
27+ const { getBlockById } = useTimeLineChart ( ETimeLineTypeType . MODULE ) ;
2228
2329 const handleOnDrop = (
2430 draggingBlockId : string | undefined ,
@@ -52,4 +58,4 @@ export const ModuleGanttSidebar: React.FC<Props> = (props) => {
5258 ) }
5359 </ div >
5460 ) ;
55- } ;
61+ } ) ;
0 commit comments