import React from 'react';
import i18n from 'ui-i18n';
import { propEq } from 'ramda';
import { DropDownSelector } from '../../../DropDownSelector';
import { useWorkflowPriority } from '../hooks/useWorkflowPriority';
export var PrioritySelector = function (_a) {
    var taskId = _a.taskId, priority = _a.priority, isTaskOpen = _a.isTaskOpen, className = _a.className;
    var _b = useWorkflowPriority({
        taskId: taskId,
        priority: priority,
        isOpen: isTaskOpen
    }), priorities = _b.priorities, updatePriority = _b.updatePriority, updateRequestIsInProgress = _b.updateRequestIsInProgress, readOnly = _b.readOnly;
    var disabled = updateRequestIsInProgress || readOnly;
    return (React.createElement(DropDownSelector, { className: className, isDisabled: disabled, options: priorities, onChange: updatePriority, hideSelectedOptions: false, label: i18n.text('Priority'), value: priorities.find(propEq('value', priority)), TextFieldProps: { disabled: disabled }, height: 40 }));
};
