import React from 'react';
import i18n from 'ui-i18n';
import { DropDownSelector } from '../../../DropDownSelector';
import { useWorkflowAssignee } from '../hooks/useWorkflowAssignee';
export var AssigneeSelector = function (_a) {
    var taskId = _a.taskId, assignee = _a.assignee, isTaskOpen = _a.isTaskOpen, label = _a.label, onChange = _a.onChange, _b = _a.showCurrentAssignee, showCurrentAssignee = _b === void 0 ? true : _b;
    var _c = useWorkflowAssignee({
        taskId: taskId,
        assignee: assignee,
        showCurrentAssignee: showCurrentAssignee,
        isOpen: isTaskOpen,
        onChange: onChange
    }), currentAssignee = _c.assignee, getAssignees = _c.getAssignees, updateAssignee = _c.updateAssignee, updateRequestIsInProgress = _c.updateRequestIsInProgress, readOnly = _c.readOnly;
    var disabled = updateRequestIsInProgress || readOnly;
    return (React.createElement(DropDownSelector, { isDisabled: disabled, getOptions: getAssignees, onChange: updateAssignee, hideSelectedOptions: false, label: label || i18n.text('Assigned to'), value: currentAssignee, defaultOptions: true, TextFieldProps: { disabled: disabled }, height: 40 }));
};
