import React from "react";
import { IconBrokenCloseCircle, IconBrokenEye, IconBrokenEyeSlash, IconBrokenInfoCircle } from "@greenatom/icons";
import Tooltip from "../../Tooltip";
import { IconWrapper, IconsBoxStyled } from "../style";
var IconsBox = function (_a) {
    var isHasValue = _a.isHasValue, isDisabled = _a.isDisabled, type = _a.type, isPasswordVisible = _a.isPasswordVisible, tooltipContent = _a.tooltipContent, tooltipPosition = _a.tooltipPosition, isShowClearIcon = _a.isShowClearIcon, onClear = _a.onClear, onPasswordToggle = _a.onPasswordToggle, _b = _a.testId, testId = _b === void 0 ? "" : _b, classNameIconBox = _a.classNameIconBox, isReadOnly = _a.isReadOnly;
    var onClickHandler = function () {
        !isDisabled && (onPasswordToggle === null || onPasswordToggle === void 0 ? void 0 : onPasswordToggle());
    };
    return (React.createElement(IconsBoxStyled, { className: classNameIconBox },
        isShowClearIcon && (React.createElement(IconWrapper, { onClick: onClear, "data-element": "input-clearFunc" }, isHasValue && !isDisabled && !isReadOnly && (React.createElement(IconBrokenCloseCircle, { "data-element": "input-clearIcon", width: 14, height: 14 })))),
        type === "password" && !isReadOnly && !isDisabled && (React.createElement(IconWrapper, { onClick: onClickHandler }, isPasswordVisible ? (React.createElement(IconBrokenEye, { "data-element": "input-hidePasswordIcon", "data-test-id": "input_eye_" + testId, width: 14, height: 14 })) : (React.createElement(IconBrokenEyeSlash, { "data-element": "input-showPasswordIcon", "data-test-id": "input_eye_" + testId, width: 14, height: 14 })))),
        tooltipContent && (React.createElement(IconWrapper, null,
            React.createElement(Tooltip, { text: tooltipContent, direction: tooltipPosition },
                React.createElement(IconBrokenInfoCircle, { width: 14, height: 14 }))))));
};
export default IconsBox;
