switch to nx monorepo

This commit is contained in:
Philipinho
2024-01-09 18:58:26 +01:00
parent e1bb2632b8
commit 093e634c0b
273 changed files with 11419 additions and 31 deletions

View File

@ -0,0 +1,37 @@
import React from 'react';
import { Avatar } from '@mantine/core';
interface UserAvatarProps {
avatarUrl: string;
name: string;
color?: string;
size?: string;
radius?: string;
style?: any;
component?: any;
}
export const UserAvatar = React.forwardRef<HTMLInputElement, UserAvatarProps>(
({ avatarUrl, name, ...props }: UserAvatarProps, ref) => {
const getInitials = (name: string) => {
const names = name.split(' ');
return names.slice(0, 2).map(n => n[0]).join('');
};
return (
avatarUrl ? (
<Avatar
ref={ref}
src={avatarUrl}
alt={name}
radius="xl"
{...props}
/>
) : (
<Avatar ref={ref}
{...props}>{getInitials(name)}</Avatar>
)
);
},
);