mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-31 11:00:06 +02:00

[web] Handle deleted users in chat threads GitOrigin-RevId: 6593bf37e4f2339b40069b7cf4198166660852fb
17 lines
295 B
TypeScript
17 lines
295 B
TypeScript
export const buildName = (user: {
|
|
first_name?: string
|
|
last_name?: string
|
|
email?: string
|
|
}) => {
|
|
const name = [user.first_name, user.last_name].filter(Boolean).join(' ')
|
|
|
|
if (name) {
|
|
return name
|
|
}
|
|
|
|
if (user.email) {
|
|
return user.email.split('@')[0]
|
|
}
|
|
|
|
return 'Unknown'
|
|
}
|