import React, { FC, useContext } from 'react';
import List from '@material-ui/core/List';
import { DetailContext } from '../../pages/Version';
import { Heading, AuthorListItem, AuthorListItemText } from './styles';
import { isEmail } from '../../utils/url';
import Avatar from '../../muiComponents/Avatar';
const Author: FC = () => {
const { packageMeta } = useContext(DetailContext);
if (!packageMeta) {
return null;
}
const { author, name: packageName, version } = packageMeta.latest;
if (!author) {
return null;
}
const { email, name } = author;
const avatarComponent = ;
return (
{'Author'}}>
{!email || !isEmail(email) ? (
avatarComponent
) : (
{avatarComponent}
)}
);
};
export default Author;