import React from "react"; // react beautiful dnd import { Droppable } from "@hello-pangea/dnd"; // components import { KanBanGroupByHeaderRoot } from "./headers/group-by-root"; import { IssueBlock } from "./block"; // constants import { ISSUE_STATE_GROUPS, ISSUE_PRIORITIES } from "constants/issue"; // mobx import { observer } from "mobx-react-lite"; // mobx import { useMobxStore } from "lib/mobx/store-provider"; import { RootStore } from "store/root"; export interface IKanBan { issues?: any; handleIssues?: () => void; handleDragDrop?: (result: any) => void | undefined; sub_group_id?: string; } export const KanBan: React.FC = observer(({ issues, sub_group_id = "null" }) => { const { project: projectStore, issueFilter: issueFilterStore }: RootStore = useMobxStore(); const group_by: string | null = issueFilterStore?.userDisplayFilters?.group_by || null; const sub_group_by: string | null = issueFilterStore?.userDisplayFilters?.sub_group_by || null; return (
{group_by && group_by === "state" && (
{projectStore?.projectStates && projectStore?.projectStates.length > 0 && projectStore?.projectStates.map((state) => (
{sub_group_by === null && (
)}
{(provided: any, snapshot: any) => (
{issues && ( )} {provided.placeholder}
)}
))}
)} {group_by && group_by === "state_detail.group" && (
{ISSUE_STATE_GROUPS && ISSUE_STATE_GROUPS.length > 0 && ISSUE_STATE_GROUPS.map((stateGroup) => (
{sub_group_by === null && (
)}
content
))}
)} {group_by && group_by === "priority" && (
{ISSUE_PRIORITIES && ISSUE_PRIORITIES.length > 0 && ISSUE_PRIORITIES.map((priority) => (
{sub_group_by === null && (
)}
content
))}
)} {group_by && group_by === "labels" && (
{projectStore?.projectLabels && projectStore?.projectLabels.length > 0 && projectStore?.projectLabels.map((label) => (
{sub_group_by === null && (
)}
content
))}
)} {group_by && group_by === "assignees" && (
{projectStore?.projectMembers && projectStore?.projectMembers.length > 0 && projectStore?.projectMembers.map((member) => (
{sub_group_by === null && (
)}
content
))}
)} {group_by && group_by === "created_by" && (
{projectStore?.projectMembers && projectStore?.projectMembers.length > 0 && projectStore?.projectMembers.map((member) => (
{sub_group_by === null && (
)}
content
))}
)}
); });