import React from "react"; // hooks import { PriorityDropdown, MemberDropdown, StateDropdown } from "@/components/dropdowns"; import { useIssueDetail } from "@/hooks/store"; // components // types import { TSubIssueOperations } from "./root"; export interface IIssueProperty { workspaceSlug: string; parentIssueId: string; issueId: string; disabled: boolean; subIssueOperations: TSubIssueOperations; } export const IssueProperty: React.FC = (props) => { const { workspaceSlug, parentIssueId, issueId, disabled, subIssueOperations } = props; // hooks const { issue: { getIssueById }, } = useIssueDetail(); const issue = getIssueById(issueId); if (!issue) return <>; return (
subIssueOperations.updateSubIssue( workspaceSlug, issue.project_id, parentIssueId, issueId, { state_id: val, }, { ...issue } ) } disabled={!disabled} buttonVariant="border-with-text" />
subIssueOperations.updateSubIssue(workspaceSlug, issue.project_id, parentIssueId, issueId, { priority: val, }) } disabled={!disabled} buttonVariant="border-without-text" buttonClassName="border" />
subIssueOperations.updateSubIssue(workspaceSlug, issue.project_id, parentIssueId, issueId, { assignee_ids: val, }) } disabled={!disabled} multiple buttonVariant={(issue?.assignee_ids || []).length > 0 ? "transparent-without-text" : "border-without-text"} buttonClassName={(issue?.assignee_ids || []).length > 0 ? "hover:bg-transparent px-0" : ""} />
); };