import React from "react"; // headless ui import { Listbox, Transition } from "@headlessui/react"; // ui import { AssigneesList, Avatar } from "components/ui"; // types import { IIssue, IProjectMember } from "types"; type Props = { issue: IIssue; members: IProjectMember[] | undefined; partialUpdateIssue: (formData: Partial) => void; isNotAllowed: boolean; }; export const AssigneeSelect: React.FC = ({ issue, members, partialUpdateIssue, isNotAllowed, }) => ( { const newData = issue.assignees ?? []; if (newData.includes(data)) newData.splice(newData.indexOf(data), 1); else newData.push(data); partialUpdateIssue({ assignees_list: newData }); }} className="group relative flex-shrink-0" disabled={isNotAllowed} > {({ open }) => ( <>
{members?.map((member) => ( `flex items-center gap-x-1 cursor-pointer select-none p-2 ${ active ? "bg-indigo-50" : "" } ${ selected || issue.assignees?.includes(member.member.id) ? "bg-indigo-50 font-medium" : "font-normal" }` } value={member.member.id} >

{member.member.first_name && member.member.first_name !== "" ? member.member.first_name : member.member.email}

))}
Assigned to
{issue.assignee_details?.length > 0 ? issue.assignee_details.map((assignee) => assignee.first_name).join(", ") : "No one"}
)}
);