"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EditorStatusChip = exports.EditorStatus = void 0;
var react_1 = __importDefault(require("react"));
var classnames_1 = __importDefault(require("classnames"));
var ui_i18n_1 = __importDefault(require("ui-i18n"));
var Chip_1 = __importDefault(require("@mui/material/Chip"));
var EditorStatusChip_module_css_1 = __importDefault(require("./EditorStatusChip.module.css"));
var EditorStatus;
(function (EditorStatus) {
    EditorStatus["UPDATED"] = "updated";
    EditorStatus["REJECTED"] = "rejected";
    EditorStatus["RECENTLY_ADDED"] = "recentlyAdded";
})(EditorStatus || (exports.EditorStatus = EditorStatus = {}));
var STATUS_CLASS = (_a = {},
    _a[EditorStatus.UPDATED] = EditorStatusChip_module_css_1.default.updatedChip,
    _a[EditorStatus.REJECTED] = EditorStatusChip_module_css_1.default.rejectedChip,
    _a[EditorStatus.RECENTLY_ADDED] = EditorStatusChip_module_css_1.default.recentlyAddedChip,
    _a);
var getStatusLabel = function (status) {
    switch (status) {
        case EditorStatus.UPDATED:
            return ui_i18n_1.default.text('Updated');
        case EditorStatus.REJECTED:
            return ui_i18n_1.default.text('Rejected');
        case EditorStatus.RECENTLY_ADDED:
            return ui_i18n_1.default.text('Recently Added');
    }
};
var EditorStatusChip = function (_a) {
    var status = _a.status;
    if (!status) {
        return null;
    }
    return (react_1.default.createElement(Chip_1.default, { label: getStatusLabel(status), size: "small", className: (0, classnames_1.default)(EditorStatusChip_module_css_1.default.statusChip, STATUS_CLASS[status]), "data-testid": "editor-status-chip" }));
};
exports.EditorStatusChip = EditorStatusChip;
