This commit is contained in:
Kirill
2026-05-25 16:54:37 +05:00
parent 74fe39829d
commit af6b249248
15 changed files with 703 additions and 452 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import * as React from 'react'
import { useMemo } from 'react'
import React from 'react'
import Box from '@mui/material/Box'
import type { SxProps, Theme } from '@mui/material/styles'
+8 -2
View File
@@ -1,5 +1,5 @@
import * as React from 'react'
import { useEffect, useRef, useState } from 'react'
import React from 'react'
import Avatar from '@mui/material/Avatar'
import type { SxProps, Theme } from '@mui/material/styles'
import { createAvatar } from '@dicebear/core'
@@ -13,7 +13,13 @@ type UserAvatarProps = {
sx?: SxProps<Theme>
}
export const UserAvatar = React.memo(function UserAvatar({ userId, avatarUrl, avatarStyle, size = 40, sx }: UserAvatarProps) {
export const UserAvatar = React.memo(function UserAvatar({
userId,
avatarUrl,
avatarStyle,
size = 40,
sx,
}: UserAvatarProps) {
const [generatedSrc, setGeneratedSrc] = useState<string | null>(null)
const styleId = avatarStyle || DEFAULT_STYLE_ID
const styleIdRef = useRef(styleId)