import gql from 'graphql-tag'; import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import MAvatar from '@material-ui/core/Avatar'; import React from 'react'; const Author = ({ author, ...props }) => { if (!author.email) { return {author.displayName}; } return ( {author.displayName} ); }; Author.fragment = gql` fragment authored on Authored { author { name email displayName avatarUrl } } `; export const Avatar = ({ author, ...props }) => { if (author.avatarUrl) { return ; } return {author.displayName[0]}; }; export default Author;