@@ -54,7 +54,7 @@ const avatarVariants = cva(
54
54
} ,
55
55
) ;
56
56
57
- export type AvatarProps = Omit < AvatarPrimitive . AvatarProps , "children" > &
57
+ export type AvatarProps = AvatarPrimitive . AvatarProps &
58
58
VariantProps < typeof avatarVariants > & {
59
59
src ?: string ;
60
60
alt ?: string ;
@@ -64,28 +64,35 @@ export type AvatarProps = Omit<AvatarPrimitive.AvatarProps, "children"> &
64
64
const Avatar = React . forwardRef <
65
65
React . ElementRef < typeof AvatarPrimitive . Root > ,
66
66
AvatarProps
67
- > ( ( { className, size, variant, alt, fallback, ...props } , ref ) => {
68
- const theme = useTheme ( ) ;
67
+ > (
68
+ (
69
+ { className, size, variant, src, alt, fallback, children, ...props } ,
70
+ ref ,
71
+ ) => {
72
+ const theme = useTheme ( ) ;
69
73
70
- return (
71
- < AvatarPrimitive . Root
72
- ref = { ref }
73
- className = { cn ( avatarVariants ( { size, variant, className } ) ) }
74
- { ...props }
75
- >
76
- < AvatarPrimitive . Image
77
- className = "aspect-square h-full w-full object-contain"
78
- css = { getExternalImageStylesFromUrl ( theme . externalImages , props . src ) }
79
- alt = { alt }
80
- />
81
- { fallback && (
82
- < AvatarPrimitive . Fallback className = "flex h-full w-full items-center justify-center rounded-full" >
83
- { fallback . charAt ( 0 ) . toUpperCase ( ) }
84
- </ AvatarPrimitive . Fallback >
85
- ) }
86
- </ AvatarPrimitive . Root >
87
- ) ;
88
- } ) ;
74
+ return (
75
+ < AvatarPrimitive . Root
76
+ ref = { ref }
77
+ className = { cn ( avatarVariants ( { size, variant, className } ) ) }
78
+ { ...props }
79
+ >
80
+ < AvatarPrimitive . Image
81
+ src = { src }
82
+ className = "aspect-square h-full w-full object-contain"
83
+ css = { getExternalImageStylesFromUrl ( theme . externalImages , src ) }
84
+ alt = { alt }
85
+ />
86
+ { fallback && (
87
+ < AvatarPrimitive . Fallback className = "flex h-full w-full items-center justify-center rounded-full" >
88
+ { fallback . charAt ( 0 ) . toUpperCase ( ) }
89
+ </ AvatarPrimitive . Fallback >
90
+ ) }
91
+ { children }
92
+ </ AvatarPrimitive . Root >
93
+ ) ;
94
+ } ,
95
+ ) ;
89
96
Avatar . displayName = AvatarPrimitive . Root . displayName ;
90
97
91
98
export { Avatar } ;
0 commit comments