feat: Add avatar component and get initials logic
This commit is contained in:
committed by
Michael Zetterberg
parent
cfb08fff2c
commit
88795b673d
@@ -6,3 +6,13 @@ export function getMembership(memberships: User["memberships"]) {
|
||||
membership.membershipType.toLowerCase() === "guestpr" || "scandicfriend's"
|
||||
)
|
||||
}
|
||||
|
||||
export function getInitials(
|
||||
firstName: User["firstName"],
|
||||
lastName: User["lastName"]
|
||||
) {
|
||||
if (!firstName || !lastName) return null
|
||||
const firstInitial = firstName.charAt(0).toUpperCase()
|
||||
const lastInitial = lastName.charAt(0).toUpperCase()
|
||||
return `${firstInitial}${lastInitial}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user