2023-10-20 11:37:46 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
// components
|
|
|
|
import { IssueBlock } from "components/issues";
|
|
|
|
// types
|
2023-11-06 15:13:10 +00:00
|
|
|
import { IIssue, IIssueDisplayProperties } from "types";
|
2023-11-23 09:17:04 +00:00
|
|
|
import { IIssueResponse, IGroupedIssues, TUnGroupedIssues } from "store/issues/types";
|
|
|
|
import { EIssueActions } from "../types";
|
2023-10-20 11:37:46 +00:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
columnId: string;
|
2023-11-23 09:17:04 +00:00
|
|
|
issueIds: IGroupedIssues | TUnGroupedIssues | any;
|
|
|
|
issues: IIssueResponse;
|
2023-11-03 14:50:05 +00:00
|
|
|
isReadonly?: boolean;
|
2023-11-23 09:17:04 +00:00
|
|
|
handleIssues: (issue: IIssue, action: EIssueActions) => void;
|
2023-10-20 11:37:46 +00:00
|
|
|
quickActions: (group_by: string | null, issue: IIssue) => React.ReactNode;
|
2023-11-23 09:17:04 +00:00
|
|
|
displayProperties: IIssueDisplayProperties | undefined;
|
2023-10-20 11:37:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const IssueBlocksList: FC<Props> = (props) => {
|
2023-11-23 09:17:04 +00:00
|
|
|
const { columnId, issueIds, issues, handleIssues, quickActions, displayProperties, isReadonly } = props;
|
2023-10-20 11:37:46 +00:00
|
|
|
|
|
|
|
return (
|
2023-10-31 06:44:06 +00:00
|
|
|
<div className="w-full h-full relative divide-y-[0.5px] divide-custom-border-200">
|
2023-11-23 09:17:04 +00:00
|
|
|
{issueIds && issueIds.length > 0 ? (
|
2023-12-06 14:28:47 +00:00
|
|
|
issueIds.map(
|
|
|
|
(issueId: string) =>
|
|
|
|
issues[issueId] && (
|
|
|
|
<IssueBlock
|
|
|
|
key={issues[issueId].id}
|
|
|
|
columnId={columnId}
|
|
|
|
issue={issues[issueId]}
|
|
|
|
handleIssues={handleIssues}
|
|
|
|
quickActions={quickActions}
|
|
|
|
isReadonly={isReadonly}
|
|
|
|
displayProperties={displayProperties}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
)
|
2023-10-31 06:44:06 +00:00
|
|
|
) : (
|
|
|
|
<div className="bg-custom-background-100 text-custom-text-400 text-sm p-3">No issues</div>
|
|
|
|
)}
|
|
|
|
</div>
|
2023-10-20 11:37:46 +00:00
|
|
|
);
|
|
|
|
};
|