2024-01-10 14:39:45 +00:00
|
|
|
import { FC } from "react";
|
2024-03-12 13:40:35 +00:00
|
|
|
import { observer } from "mobx-react";
|
2024-01-10 14:39:45 +00:00
|
|
|
// components
|
|
|
|
import { LabelListItem } from "./label-list-item";
|
|
|
|
// types
|
|
|
|
import { TLabelOperations } from "./root";
|
|
|
|
|
|
|
|
type TLabelList = {
|
|
|
|
workspaceSlug: string;
|
|
|
|
projectId: string;
|
|
|
|
issueId: string;
|
2024-04-08 13:41:47 +00:00
|
|
|
values: string[];
|
2024-01-10 14:39:45 +00:00
|
|
|
labelOperations: TLabelOperations;
|
2024-01-11 12:56:58 +00:00
|
|
|
disabled: boolean;
|
2024-01-10 14:39:45 +00:00
|
|
|
};
|
|
|
|
|
2024-03-12 13:40:35 +00:00
|
|
|
export const LabelList: FC<TLabelList> = observer((props) => {
|
2024-04-08 13:41:47 +00:00
|
|
|
const { workspaceSlug, projectId, issueId, values, labelOperations, disabled } = props;
|
|
|
|
const issueLabels = values || undefined;
|
2024-01-10 14:39:45 +00:00
|
|
|
|
2024-04-08 13:41:47 +00:00
|
|
|
if (!issueId || !issueLabels) return <></>;
|
2024-01-10 14:39:45 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{issueLabels.map((labelId) => (
|
|
|
|
<LabelListItem
|
2024-03-06 13:09:14 +00:00
|
|
|
key={labelId}
|
2024-01-10 14:39:45 +00:00
|
|
|
workspaceSlug={workspaceSlug}
|
|
|
|
projectId={projectId}
|
|
|
|
issueId={issueId}
|
|
|
|
labelId={labelId}
|
2024-04-08 13:41:47 +00:00
|
|
|
values={issueLabels}
|
2024-01-10 14:39:45 +00:00
|
|
|
labelOperations={labelOperations}
|
2024-01-11 12:56:58 +00:00
|
|
|
disabled={disabled}
|
2024-01-10 14:39:45 +00:00
|
|
|
/>
|
|
|
|
))}
|
|
|
|
</>
|
|
|
|
);
|
2024-03-12 13:40:35 +00:00
|
|
|
});
|