import React from "react"; // ui import { CustomSelect, Tooltip } from "components/ui"; // icons import { getPriorityIcon } from "components/icons/priority-icon"; // types import { IIssue } from "types"; // constants import { PRIORITIES } from "constants/project"; // services import trackEventServices from "services/track-event.service"; import useEstimateOption from "hooks/use-estimate-option"; type Props = { issue: IIssue; partialUpdateIssue: (formData: Partial) => void; position?: "left" | "right"; selfPositioned?: boolean; isNotAllowed: boolean; }; export const ViewEstimateSelect: React.FC = ({ issue, partialUpdateIssue, position = "left", selfPositioned = false, isNotAllowed, }) => { const { isEstimateActive, estimatePoints, estimateValue } = useEstimateOption( issue.estimate_point ); return ( { partialUpdateIssue({ priority: data, state: issue.state, target_date: issue.target_date }); trackEventServices.trackIssuePartialPropertyUpdateEvent( { workspaceSlug: issue.workspace_detail.slug, workspaceId: issue.workspace_detail.id, projectId: issue.project_detail.id, projectIdentifier: issue.project_detail.identifier, projectName: issue.project_detail.name, issueId: issue.id, }, "ISSUE_PROPERTY_UPDATE_PRIORITY" ); }} label={ <>{estimateValue} } maxHeight="md" noChevron disabled={isNotAllowed} position={position} selfPositioned={selfPositioned} > {estimatePoints?.map((estimate) => ( <>{estimate.value} ))} ); };