import React, { useRef, useEffect } from "react"; import { GridProps, Grid } from "../grid/grid"; import { CalendarProps, Calendar } from "../calendar/calendar"; import { TaskGanttContentProps, TaskGanttContent } from "./task-gantt-content"; import styles from "./gantt.module.css"; export type TaskGanttProps = { gridProps: GridProps; calendarProps: CalendarProps; barProps: TaskGanttContentProps; ganttHeight: number; scroll: number; }; export const TaskGantt: React.FC = ({ gridProps, calendarProps, barProps, ganttHeight, scroll, }) => { const ganttSVGRef = useRef(null); const horizontalContainerRef = useRef(null); const newBarProps = { ...barProps, svg: ganttSVGRef }; useEffect(() => { if (horizontalContainerRef.current) { horizontalContainerRef.current.scrollTop = scroll; } }, [scroll]); return (
); };