11import { clsx } from 'clsx'
22import React from 'react'
3- import type { SxProp } from '../sx'
43import type { ResponsiveValue } from '../hooks/useResponsiveValue'
54import { isResponsiveValue } from '../hooks/useResponsiveValue'
6- import { BoxWithFallback } from '../internal/components/BoxWithFallback'
75import classes from './Avatar.module.css'
86
97export const DEFAULT_AVATAR_SIZE = 20
@@ -19,11 +17,10 @@ export type AvatarProps = {
1917 alt ?: string
2018 /** Additional class name. */
2119 className ?: string
22- } & SxProp &
23- React . ComponentPropsWithoutRef < 'img' >
20+ } & React . ComponentPropsWithoutRef < 'img' >
2421
2522const Avatar = React . forwardRef < HTMLImageElement , AvatarProps > ( function Avatar (
26- { alt = '' , size = DEFAULT_AVATAR_SIZE , square = false , sx : sxProp , className, style, ...rest } ,
23+ { alt = '' , size = DEFAULT_AVATAR_SIZE , square = false , className, style, ...rest } ,
2724 ref ,
2825) {
2926 const isResponsive = isResponsiveValue ( size )
@@ -38,8 +35,7 @@ const Avatar = React.forwardRef<HTMLImageElement, AvatarProps>(function Avatar(
3835 }
3936
4037 return (
41- < BoxWithFallback
42- as = "img"
38+ < img
4339 data-component = "Avatar"
4440 className = { clsx ( className , classes . Avatar ) }
4541 ref = { ref }
@@ -56,7 +52,6 @@ const Avatar = React.forwardRef<HTMLImageElement, AvatarProps>(function Avatar(
5652 }
5753 : ( cssSizeVars as React . CSSProperties )
5854 }
59- sx = { sxProp }
6055 { ...rest }
6156 />
6257 )
0 commit comments