analytica-frontend-lib
Version:
Repositório público dos componentes utilizados nas plataformas da Analytica Ensino
115 lines (114 loc) • 3.48 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/types/support.ts
var support_exports = {};
__export(support_exports, {
SupportCategory: () => SupportCategory,
SupportStatus: () => SupportStatus,
getCategoryText: () => getCategoryText,
getStatusBadgeAction: () => getStatusBadgeAction,
getStatusText: () => getStatusText,
mapApiStatusToInternal: () => mapApiStatusToInternal,
mapInternalStatusToApi: () => mapInternalStatusToApi
});
module.exports = __toCommonJS(support_exports);
var SupportStatus = /* @__PURE__ */ ((SupportStatus2) => {
SupportStatus2["ABERTO"] = "aberto";
SupportStatus2["RESPONDIDO"] = "respondido";
SupportStatus2["ENCERRADO"] = "encerrado";
return SupportStatus2;
})(SupportStatus || {});
var SupportCategory = /* @__PURE__ */ ((SupportCategory2) => {
SupportCategory2["ACESSO"] = "acesso";
SupportCategory2["TECNICO"] = "tecnico";
SupportCategory2["OUTROS"] = "outros";
return SupportCategory2;
})(SupportCategory || {});
var getStatusBadgeAction = (status) => {
switch (status) {
case "aberto" /* ABERTO */:
return "success";
case "respondido" /* RESPONDIDO */:
return "warning";
case "encerrado" /* ENCERRADO */:
return "info";
default:
return "info";
}
};
var getStatusText = (status) => {
switch (status) {
case "aberto" /* ABERTO */:
return "Aberto";
case "respondido" /* RESPONDIDO */:
return "Respondido";
case "encerrado" /* ENCERRADO */:
return "Encerrado";
default:
return status;
}
};
var getCategoryText = (category) => {
if (!category) return "";
switch (category) {
case "acesso" /* ACESSO */:
return "Acesso";
case "tecnico" /* TECNICO */:
return "T\xE9cnico";
case "outros" /* OUTROS */:
return "Outros";
default:
return category;
}
};
var mapApiStatusToInternal = (apiStatus) => {
switch (apiStatus) {
case "ABERTO":
return "aberto" /* ABERTO */;
case "PENDENTE":
return "respondido" /* RESPONDIDO */;
case "FECHADO":
return "encerrado" /* ENCERRADO */;
default:
return "aberto" /* ABERTO */;
}
};
var mapInternalStatusToApi = (internalStatus) => {
switch (internalStatus) {
case "aberto" /* ABERTO */:
return "ABERTO";
case "respondido" /* RESPONDIDO */:
return "PENDENTE";
case "encerrado" /* ENCERRADO */:
return "FECHADO";
default:
return "ABERTO";
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SupportCategory,
SupportStatus,
getCategoryText,
getStatusBadgeAction,
getStatusText,
mapApiStatusToInternal,
mapInternalStatusToApi
});
//# sourceMappingURL=index.js.map