Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

473 B
Raw Blame
const BUILT_IN_ROLE_LABEL_KEYS = new Map([
  ["owner", "team:roles.owner"],
  ["admin", "team:roles.admin"],
  ["member", "team:roles.member"],
  ["viewer", "team:roles.viewer"],
]);

export function getWorkspaceRoleLabel(
  role: string,
  t: (key: string) => string,
) {
  return role
    .split(",")
    .filter((name) => name !== "")
    .map((name) => {
      const key = BUILT_IN_ROLE_LABEL_KEYS.get(name);
      return key ? t(key) : name;
    })
    .join(", ");
}