2024-02-23 13:40:45 +00:00
|
|
|
import { useContext } from "react";
|
|
|
|
// mobx store
|
2024-03-19 14:38:35 +00:00
|
|
|
import { GanttStoreContext } from "@/components/gantt-chart/contexts";
|
2024-02-23 13:40:45 +00:00
|
|
|
// types
|
2024-03-19 14:38:35 +00:00
|
|
|
import { IGanttStore } from "@/store/issue/issue_gantt_view.store";
|
2024-02-23 13:40:45 +00:00
|
|
|
|
|
|
|
export const useGanttChart = (): IGanttStore => {
|
|
|
|
const context = useContext(GanttStoreContext);
|
|
|
|
if (context === undefined) throw new Error("useGanttChart must be used within GanttStoreProvider");
|
|
|
|
return context;
|
|
|
|
};
|