2023-08-11 11:48:33 +00:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
// mobx react lite
|
|
|
|
import { observer } from "mobx-react-lite";
|
|
|
|
// components
|
|
|
|
import { IssueListHeader } from "components/issues/board-views/kanban/header";
|
|
|
|
import { IssueListBlock } from "components/issues/board-views/kanban/block";
|
2023-09-01 11:51:52 +00:00
|
|
|
// ui
|
|
|
|
import { Icon } from "components/ui";
|
2023-08-11 11:48:33 +00:00
|
|
|
// interfaces
|
2023-09-01 11:12:30 +00:00
|
|
|
import { IIssueState, IIssue } from "types/issue";
|
2023-08-11 11:48:33 +00:00
|
|
|
// mobx hook
|
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
|
|
import { RootStore } from "store/root";
|
|
|
|
|
|
|
|
export const IssueKanbanView = observer(() => {
|
|
|
|
const store: RootStore = useMobxStore();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="relative w-full h-full overflow-hidden overflow-x-auto flex gap-3">
|
|
|
|
{store?.issue?.states &&
|
|
|
|
store?.issue?.states.length > 0 &&
|
|
|
|
store?.issue?.states.map((_state: IIssueState) => (
|
2023-09-01 11:12:30 +00:00
|
|
|
<div key={_state.id} className="flex-shrink-0 relative w-[340px] h-full flex flex-col">
|
2023-08-11 11:48:33 +00:00
|
|
|
<div className="flex-shrink-0">
|
|
|
|
<IssueListHeader state={_state} />
|
|
|
|
</div>
|
2023-09-01 11:12:30 +00:00
|
|
|
<div className="w-full h-full overflow-hidden overflow-y-auto hide-vertical-scrollbar">
|
2023-08-11 11:48:33 +00:00
|
|
|
{store.issue.getFilteredIssuesByState(_state.id) &&
|
|
|
|
store.issue.getFilteredIssuesByState(_state.id).length > 0 ? (
|
2023-09-01 11:12:30 +00:00
|
|
|
<div className="space-y-3 pb-2 px-2">
|
2023-08-11 11:48:33 +00:00
|
|
|
{store.issue.getFilteredIssuesByState(_state.id).map((_issue: IIssue) => (
|
2023-09-01 11:12:30 +00:00
|
|
|
<IssueListBlock key={_issue.id} issue={_issue} />
|
2023-08-11 11:48:33 +00:00
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
) : (
|
2023-09-01 11:51:52 +00:00
|
|
|
<div className="flex justify-center items-center gap-2 pt-10 text-center text-sm text-custom-text-200 font-medium">
|
|
|
|
<Icon iconName="stack" />
|
|
|
|
No issues in this state
|
2023-08-11 11:48:33 +00:00
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
))}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
});
|