import { Avatar as ShadAvatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { User } from 'lucide-react';
import { cn } from 'helpers/cn';

type AvatarProps = {
  src?: string | null;
  className?: string;
} & React.ComponentProps<typeof ShadAvatar>;

export const Avatar = ({ src = '', className, ...props }: AvatarProps) => {
  return (
    <ShadAvatar {...props} className={cn('h-10 w-10 rounded-md', className)}>
      <AvatarImage src={src || ''} />
      <AvatarFallback className="rounded-md">
        <User />
      </AvatarFallback>
    </ShadAvatar>
  );
};
