mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2025-12-18 20:59:32 +00:00
24 lines
490 B
TypeScript
24 lines
490 B
TypeScript
import { CSSProperties, ComponentPropsWithoutRef } from 'react'
|
|
|
|
import clsx from 'clsx'
|
|
|
|
import s from './avatar.module.scss'
|
|
|
|
export type AvatarProps = ComponentPropsWithoutRef<'img'> & {
|
|
size?: CSSProperties['width']
|
|
}
|
|
|
|
export const Avatar = ({ className, size = '36px', style, ...rest }: AvatarProps) => {
|
|
return (
|
|
<img
|
|
className={clsx(className, s.avatar)}
|
|
style={{
|
|
...style,
|
|
height: size,
|
|
width: size,
|
|
}}
|
|
{...rest}
|
|
/>
|
|
)
|
|
}
|