plane/web/components/issues/issue-layouts/list/headers/assignee.tsx
rahulramesha 03387848fe add functionality for addition of existing issues to modules and cycles (#2913)
Co-authored-by: sriram veeraghanta <veeraghanta.sriram@gmail.com>
2023-12-07 19:59:35 +05:30

42 lines
1.2 KiB
TypeScript

import { FC } from "react";
import { observer } from "mobx-react-lite";
// components
import { HeaderGroupByCard } from "./group-by-card";
// ui
import { Avatar } from "@plane/ui";
import { EProjectStore } from "store/command-palette.store";
import { IIssue } from "types";
export interface IAssigneesHeader {
column_id: string;
column_value: any;
issues_count: number;
disableIssueCreation?: boolean;
currentStore: EProjectStore;
addIssuesToView?: (issueIds: string[]) => Promise<IIssue>;
}
export const Icon = ({ user }: any) => <Avatar name={user.display_name} src={user.avatar} size="md" />;
export const AssigneesHeader: FC<IAssigneesHeader> = observer((props) => {
const { column_value, issues_count, disableIssueCreation, currentStore, addIssuesToView } = props;
const assignee = column_value ?? null;
return (
<>
{assignee && (
<HeaderGroupByCard
icon={<Icon user={assignee} />}
title={assignee?.display_name || ""}
count={issues_count}
issuePayload={{ assignees: [assignee?.member?.id] }}
disableIssueCreation={disableIssueCreation}
currentStore={currentStore}
addIssuesToView={addIssuesToView}
/>
)}
</>
);
});