feat(chore): ✨ add avatar utility class
This commit is contained in:
parent
3e3fd59fe7
commit
873f4d23dc
8
src/models/utils/avatar.ts
Normal file
8
src/models/utils/avatar.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import type { UrlString } from '@/types.ts'
|
||||
|
||||
export class Avatar {
|
||||
static fromEmoji(emoji: string): UrlString {
|
||||
return `data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%2210 0 100 100%22><text y=%22.90em%22 font-size=%2290%22>${emoji}</text></svg>`
|
||||
}
|
||||
private constructor() {}
|
||||
}
|
Loading…
Reference in a new issue