// react-beautiful-dnd import { DragDropContext, Draggable, DropResult } from "react-beautiful-dnd"; // hooks import useIssueView from "hooks/use-issue-view"; // components import StrictModeDroppable from "components/dnd/StrictModeDroppable"; import { SingleBoard } from "components/core/board-view/single-board"; // types import { IIssue, IProjectMember, IState, UserAuth } from "types"; type Props = { type: "issue" | "cycle" | "module"; issues: IIssue[]; states: IState[] | undefined; members: IProjectMember[] | undefined; addIssueToState: (groupTitle: string, stateId: string | null) => void; openIssuesListModal?: (() => void) | null; handleDeleteIssue: (issue: IIssue) => void; handleOnDragEnd: (result: DropResult) => void; userAuth: UserAuth; }; export const AllBoards: React.FC = ({ type, issues, states, members, addIssueToState, openIssuesListModal, handleDeleteIssue, handleOnDragEnd, userAuth, }) => { const { groupedByIssues, groupByProperty: selectedGroup } = useIssueView(issues); return ( <> {groupedByIssues ? (
{(provided) => (
{Object.keys(groupedByIssues).map((singleGroup, index) => { const stateId = selectedGroup === "state_detail.name" ? states?.find((s) => s.name === singleGroup)?.id ?? null : null; const bgColor = selectedGroup === "state_detail.name" ? states?.find((s) => s.name === singleGroup)?.color : "#000000"; return ( {(provided, snapshot) => ( addIssueToState(singleGroup, stateId)} handleDeleteIssue={handleDeleteIssue} openIssuesListModal={openIssuesListModal ?? null} userAuth={userAuth} /> )} ); })}
{provided.placeholder}
)}
) : (
Loading...
)} ); };