Create assets helper
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
23
packages/helpers/src/assets.ts
Normal file
23
packages/helpers/src/assets.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
export const getAssetTypeVariant = (type: string) => {
|
||||
switch (type) {
|
||||
case "PHYSICAL":
|
||||
return "neutral";
|
||||
case "VIRTUAL":
|
||||
return "info";
|
||||
default:
|
||||
return "neutral";
|
||||
}
|
||||
};
|
||||
|
||||
export const getCriticityVariant = (criticity: string) => {
|
||||
switch (criticity) {
|
||||
case "HIGH":
|
||||
return "danger";
|
||||
case "MEDIUM":
|
||||
return "warning";
|
||||
case "LOW":
|
||||
return "neutral";
|
||||
default:
|
||||
return "neutral";
|
||||
}
|
||||
};
|
||||
@@ -14,5 +14,6 @@ export { getRole, getRoles, peopleRoles } from "./people";
|
||||
export { certificationCategoryLabel, certifications } from "./certifications";
|
||||
export { availableFrameworks } from "./frameworks";
|
||||
export { getDocumentTypeLabel, documentTypes } from "./documents";
|
||||
export { getAssetTypeVariant, getCriticityVariant } from "./assets";
|
||||
export { promisifyMutation } from "./relay";
|
||||
export { fileType, fileSize } from "./file";
|
||||
|
||||
Reference in New Issue
Block a user