import React from "react"; // react beautiful dnd import { DragDropContext, Droppable } from "react-beautiful-dnd"; // components import { IssueHeader } from "./header"; import { IssueContent } from "./content"; // mobx import { observer } from "mobx-react-lite"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; import { RootStore } from "store/root"; export const IssueKanBanViewRoot = observer(() => { const { issueView: issueViewStore, issueKanBanView: issueKanBanViewStore }: RootStore = useMobxStore(); const onDragEnd = (result: any) => { if (!result) return; if ( result.destination && result.source && result.destination.droppableId === result.source.droppableId && result.destination.index === result.source.index ) return; issueKanBanViewStore?.handleDragDrop(result.source, result.destination); }; return (
{issueViewStore.loader || issueViewStore?.getIssues === null ? (
Loading...
) : ( <> {issueViewStore?.getIssues && Object.keys(issueViewStore?.getIssues).length > 0 ? (
{Object.keys(issueViewStore?.getIssues).map((_issueStateKey: any) => (
{(provided: any, snapshot: any) => (
{issueViewStore?.getIssues && ( )} {provided.placeholder}
)}
))}
) : (
No Issues are available
)} )}
); });