import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import FavoriteIcon from '@material-ui/icons/Favorite'; import ShareIcon from '@material-ui/icons/Share'; import Comment from '@material-ui/icons/Comment'; import { Card, CardActions, CardContent, IconButton } from '@material-ui/core'; import styles from './cardStyle-jss'; class GeneralCard extends React.Component { render() { const { classes, children, liked, shared, commented } = this.props; return ( {children} 0 && classes.liked} /> {liked} 0 && classes.shared} /> {shared} {commented} ); } } GeneralCard.propTypes = { classes: PropTypes.object.isRequired, children: PropTypes.node.isRequired, liked: PropTypes.number.isRequired, shared: PropTypes.number.isRequired, commented: PropTypes.number.isRequired, }; export default withStyles(styles)(GeneralCard);