// hooks import useProjectIssuesView from "hooks/use-issues-view"; // components import { SingleBoard } from "components/core/board-view/single-board"; // helpers import { addSpaceIfCamelCase } from "helpers/string.helper"; // types import { IIssue, IState, UserAuth } from "types"; import { getStateGroupIcon } from "components/icons"; type Props = { type: "issue" | "cycle" | "module"; states: IState[] | undefined; addIssueToState: (groupTitle: string) => void; makeIssueCopy: (issue: IIssue) => void; handleEditIssue: (issue: IIssue) => void; openIssuesListModal?: (() => void) | null; handleDeleteIssue: (issue: IIssue) => void; handleTrashBox: (isDragging: boolean) => void; removeIssue: ((bridgeId: string) => void) | null; isCompleted?: boolean; userAuth: UserAuth; }; export const AllBoards: React.FC = ({ type, states, addIssueToState, makeIssueCopy, handleEditIssue, openIssuesListModal, handleDeleteIssue, handleTrashBox, removeIssue, isCompleted = false, userAuth, }) => { const { groupedByIssues, groupByProperty: selectedGroup, showEmptyGroups, } = useProjectIssuesView(); return ( <> {groupedByIssues ? (
{Object.keys(groupedByIssues).map((singleGroup, index) => { const currentState = selectedGroup === "state" ? states?.find((s) => s.id === singleGroup) : null; if (!showEmptyGroups && groupedByIssues[singleGroup].length === 0) return null; return ( addIssueToState(singleGroup)} handleDeleteIssue={handleDeleteIssue} openIssuesListModal={openIssuesListModal ?? null} handleTrashBox={handleTrashBox} removeIssue={removeIssue} isCompleted={isCompleted} userAuth={userAuth} /> ); })} {!showEmptyGroups && (

Hidden groups

{Object.keys(groupedByIssues).map((singleGroup, index) => { const currentState = selectedGroup === "state" ? states?.find((s) => s.id === singleGroup) : null; if (groupedByIssues[singleGroup].length === 0) return (
{currentState && getStateGroupIcon(currentState.group, "16", "16", currentState.color)}

{selectedGroup === "state" ? addSpaceIfCamelCase(currentState?.name ?? "") : addSpaceIfCamelCase(singleGroup)}

0
); })}
)}
) : null} ); };