bb-plane-fork/apps/web/ce/hooks/use-timeline-chart.ts
Aaron 0ab94ed6d6
chore: run fixes (#8257)
* chore: run fixes

* fix: type, just use hocuspocusservercontext

* fix: codemod

---------

Co-authored-by: Palanikannan M <akashmalinimurugu@gmail.com>
2025-12-08 22:26:50 +05:30

26 lines
930 B
TypeScript

// types
import type { TTimelineTypeCore } from "@plane/types";
import { GANTT_TIMELINE_TYPE } from "@plane/types";
// Plane-web
import type { IBaseTimelineStore } from "@/plane-web/store/timeline/base-timeline.store";
import type { ITimelineStore } from "../store/timeline";
export const getTimelineStore = (
timelineStore: ITimelineStore,
timelineType: TTimelineTypeCore
): IBaseTimelineStore => {
if (timelineType === GANTT_TIMELINE_TYPE.ISSUE) {
return timelineStore.issuesTimeLineStore as IBaseTimelineStore;
}
if (timelineType === GANTT_TIMELINE_TYPE.MODULE) {
return timelineStore.modulesTimeLineStore as IBaseTimelineStore;
}
if (timelineType === GANTT_TIMELINE_TYPE.PROJECT) {
return timelineStore.projectTimeLineStore;
}
if (timelineType === GANTT_TIMELINE_TYPE.GROUPED) {
return timelineStore.groupedTimeLineStore;
}
throw new Error(`Unknown timeline type: ${timelineType}`);
};