"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolStatus = ToolStatus;
const jsx_runtime_1 = require("react/jsx-runtime");
const uikit_1 = require("@gravity-ui/uikit");
const cn_1 = require("../../../utils/cn.js");
const ToolIndicator_1 = require("../../atoms/ToolIndicator/index.js");
const i18n_1 = require("./i18n/index.js");
require("./ToolStatus.css");
const b = (0, cn_1.block)('tool-status');
function getIndicatorStatus(status) {
    if (status === 'success' || status === 'error' || status === 'loading') {
        return status;
    }
    return undefined;
}
function ToolStatus(props) {
    const { status, className, qa } = props;
    const indicatorStatus = getIndicatorStatus(status);
    if (status === 'cancelled') {
        return ((0, jsx_runtime_1.jsx)(uikit_1.Text, { color: "secondary", className: b('', className), "data-qa": qa, children: (0, i18n_1.i18n)('status-cancelled') }));
    }
    if (indicatorStatus) {
        return (0, jsx_runtime_1.jsx)(ToolIndicator_1.ToolIndicator, { status: indicatorStatus, className: className, qa: qa });
    }
    return null;
}
//# sourceMappingURL=index.js.map
