2024-01-11 12:56:58 +00:00
|
|
|
import { FC } from "react";
|
|
|
|
// components
|
2024-03-06 13:09:14 +00:00
|
|
|
import { TLabelOperations } from "../root";
|
2024-01-11 12:56:58 +00:00
|
|
|
import { IssueLabelSelect } from "./label-select";
|
|
|
|
// types
|
|
|
|
|
|
|
|
type TIssueLabelSelectRoot = {
|
|
|
|
workspaceSlug: string;
|
|
|
|
projectId: string;
|
|
|
|
issueId: string;
|
|
|
|
labelOperations: TLabelOperations;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const IssueLabelSelectRoot: FC<TIssueLabelSelectRoot> = (props) => {
|
|
|
|
const { workspaceSlug, projectId, issueId, labelOperations } = props;
|
|
|
|
|
|
|
|
const handleLabel = async (_labelIds: string[]) => {
|
|
|
|
await labelOperations.updateIssue(workspaceSlug, projectId, issueId, { label_ids: _labelIds });
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<IssueLabelSelect workspaceSlug={workspaceSlug} projectId={projectId} issueId={issueId} onSelect={handleLabel} />
|
|
|
|
);
|
|
|
|
};
|