mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-06 07:42:04 +00:00
feat(auth): add getPrimaryUserRole helper for header display
This commit is contained in:
parent
5ec91d5c35
commit
588a765089
1 changed files with 6 additions and 0 deletions
6
src/lib/auth/user-utils.ts
Normal file
6
src/lib/auth/user-utils.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export function getPrimaryUserRole(
|
||||
userRoles: string | null | undefined,
|
||||
fallback = "User",
|
||||
): string {
|
||||
return userRoles?.split(",")[0]?.trim() || fallback;
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue