import React from 'react';
import PropTypes from 'prop-types';
import defaultAvatarUrl from '../../assets/img/team/avatar.png';
import Avatar from '../common/Avatar';

const JKProfileAvatar = ({ url, size, className }) => {
  const avatarUrl = () => {
    if (url) {
      return url;
    } else {
      return defaultAvatarUrl;
    }
  };

  return <Avatar src={avatarUrl()} size={size} className={className}  />;
};

JKProfileAvatar.propTypes = {
  url: PropTypes.string,
  size: PropTypes.string
};

JKProfileAvatar.defaultProps = {
  size: 'l'
};

export default JKProfileAvatar;
