|
|
@@ -100,7 +100,22 @@ const normalizeString = (val) =>
|
|
|
val
|
|
|
.toLowerCase()
|
|
|
.normalize("NFKD")
|
|
|
- .replace(/[\u0300-\u036f~]/g, "");
|
|
|
+ .replace(/[̀-ͯ~]/g, "");
|
|
|
+
|
|
|
+const getStatusColor = (status) => {
|
|
|
+ const s = typeof status === "object" ? status?.value : status;
|
|
|
+ if (s === "active") return "positive";
|
|
|
+ if (s === "pending") return "warning";
|
|
|
+ return "grey-6";
|
|
|
+};
|
|
|
+
|
|
|
+const getStatusI18nKey = (status) => {
|
|
|
+ const s = typeof status === "object" ? status?.value : status;
|
|
|
+ if (s === "active") return "common.status.active";
|
|
|
+ if (s === "inactive") return "common.status.inactive";
|
|
|
+ if (s === "pending") return "common.status.pending";
|
|
|
+ return "common.status.inactive";
|
|
|
+};
|
|
|
|
|
|
export {
|
|
|
formatDateDMYtoYMD,
|
|
|
@@ -109,4 +124,6 @@ export {
|
|
|
convertDateTime,
|
|
|
formatToBRLCurrency,
|
|
|
normalizeString,
|
|
|
+ getStatusColor,
|
|
|
+ getStatusI18nKey,
|
|
|
};
|