import React, { FC, useContext } from 'react';
import List from '@material-ui/core/List';
import { DetailContext } from '../../pages/Version';
import { isEmail } from '../../utils/url';
import Avatar from '../../muiComponents/Avatar';
import { StyledText, AuthorListItem, AuthorListItemText } from './styles';
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;