init
This commit is contained in:
15
src/components/avatar.tsx
Normal file
15
src/components/avatar.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Avatar as MantineAvatar, AvatarProps as MantineAvatarProps, Paper } from '@mantine/core';
|
||||
|
||||
interface AvatarProps extends Omit<MantineAvatarProps, 'radius' | 'color' | 'size'> {
|
||||
name: string;
|
||||
size?: number;
|
||||
radius?: string | number;
|
||||
}
|
||||
|
||||
const Avatar = ({ name, size = 35, radius = '100%', ...props }: AvatarProps) => {
|
||||
return <Paper p={size / 20} radius={radius} withBorder>
|
||||
<MantineAvatar alt={name} key={name} name={name} color='initials' size={size} radius={radius} {...props} />
|
||||
</Paper>
|
||||
}
|
||||
|
||||
export default Avatar;
|
||||
Reference in New Issue
Block a user