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:
committed by
Sacha Al Himdani
parent
6862841459
commit
b94b58e2de
@@ -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";
|
||||
|
||||
37
packages/helpers/src/people.ts
Normal file
37
packages/helpers/src/people.ts
Normal 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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user