/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import { observer } from "mobx-react"; import { SignalHigh } from "lucide-react"; import { ISSUE_PRIORITIES } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { LabelPropertyIcon, PriorityIcon, PriorityPropertyIcon } from "@plane/propel/icons"; import type { TIssue } from "@plane/types"; import { PriorityDropdown } from "@/components/dropdowns/priority"; import { IssueLabelSelect } from "@/components/issues/select"; import type { TIssueOperations } from "@/components/issues/issue-detail"; type Props = { workspaceSlug: string; targetProjectId: string; issue: Partial & { project_detail?: { name?: string } | null; }; issueOperations: TIssueOperations; isEditable: boolean; }; export const ExternalContoursIssueContentProperties = observer(function ExternalContoursIssueContentProperties(props: Props) { const { workspaceSlug, targetProjectId, issue, issueOperations, isEditable } = props; const { t } = useTranslation(); const selectedLabels = issue.label_details ?? []; const priorityDetails = ISSUE_PRIORITIES.find((priority) => priority.key === issue?.priority); if (!issue || !issue?.id) return <>; return (
{t("external_contours_page.properties.section_title")}
{t("priority")}
issue?.id && issueOperations.update(workspaceSlug, targetProjectId, issue.id, { priority: val })} disabled={!isEditable} placement="top-start" buttonVariant="transparent-without-text" className="flex-1 overflow-visible" buttonContainerClassName="nodedc-external-property-control-shell h-full w-full overflow-visible rounded-[1.25rem] border-0 bg-transparent shadow-none outline-none" button={
{issue.priority && issue.priority !== "none" ? ( ) : ( )} {issue.priority && issue.priority !== "none" ? priorityDetails?.title : t("external_contours_page.form.priority")}
} />
{t("labels")}
issue?.id && issueOperations.update(workspaceSlug, targetProjectId, issue.id, { label_ids: labelIds })} projectId={targetProjectId} disabled={!isEditable} placement="top-start" rootClassName="w-full overflow-visible" buttonContainerClassName="nodedc-external-property-control-shell h-full w-full overflow-visible rounded-[1.25rem] border-0 bg-transparent shadow-none outline-none" label={
0 ? "truncate text-primary" : "truncate text-tertiary"}> {selectedLabels.length > 0 ? selectedLabels.length === 1 ? selectedLabels[0]?.name : `${selectedLabels.length} ${t("labels").toLocaleLowerCase()}` : t("labels")}
} />
); });