Function
initialsFor
(name: string | null, email: string)
Source from the content-addressed store, hash-verified
| 252 | // ── Avatar / initials ────────────────────────────────────────────────────── |
| 253 | |
| 254 | function initialsFor(name: string | null, email: string) { |
| 255 | if (name) { |
| 256 | return name |
| 257 | .split(" ") |
| 258 | .map((n) => n[0]) |
| 259 | .join("") |
| 260 | .slice(0, 2) |
| 261 | .toUpperCase(); |
| 262 | } |
| 263 | return email[0]!.toUpperCase(); |
| 264 | } |
| 265 | |
| 266 | function Avatar(props: { url: string | null; name: string | null; email: string }) { |
| 267 | if (props.url) { |
Tested by
no test coverage detected