Add people pages

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Jonathan
2025-05-31 18:04:54 +02:00
committed by Sacha Al Himdani
parent 6862841459
commit b94b58e2de
30 changed files with 2589 additions and 213 deletions

View File

@@ -9,3 +9,4 @@ export {
export { times, groupBy, isEmpty } from "./array";
export { randomInt } from "./number";
export { getMeasureStateLabel, measureStates } from "./measure";
export { getRole, getRoles, peopleRoles } from "./people";

View File

@@ -0,0 +1,37 @@
type Translator = (s: string) => string;
export const peopleRoles = [
"EMPLOYEE",
"CONTRACTOR",
"SERVICE_ACCOUNT",
] as const;
export function getRoles(__: Translator) {
return [
{
value: "EMPLOYEE",
label: __("Employee"),
},
{
value: "CONTRACTOR",
label: __("Contractor"),
},
{
value: "SERVICE_ACCOUNT",
label: __("Service account"),
},
];
}
export function getRole(__: Translator, role?: string): string {
switch (role) {
case "EMPLOYEE":
return __("Employee");
case "CONTRACTOR":
return __("Contractor");
case "SERVICE_ACCOUNT":
return __("Service account");
default:
return __("Unknown");
}
}