1import Tooltip from '@material-ui/core/Tooltip/Tooltip';
2import React from 'react';
3import { withStyles } from '@material-ui/core/styles';
4
5const styles = theme => ({
6 author: {
7 ...theme.typography.body2,
8 },
9 bold: {
10 fontWeight: 'bold',
11 },
12});
13
14const Author = ({ author, bold, classes }) => {
15 const klass = bold ? [classes.author, classes.bold] : [classes.author];
16
17 return (
18 <Tooltip title={author.email}>
19 <span className={klass.join(' ')}>{author.name}</span>
20 </Tooltip>
21 );
22};
23
24export default withStyles(styles)(Author);