import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import classNames from 'classnames'; import tableStyles from 'ba-styles/Table.scss'; import { Toolbar, Typography, Table, TableBody, TableCell, TableHead, TableRow, Paper, } from '@material-ui/core'; const styles = theme => ({ root: { width: '100%', marginTop: theme.spacing(3), overflowX: 'auto', }, table: { minWidth: 700, }, }); let id = 0; function createData(name, calories, fat, carbs, protein) { id += 1; return { id, name, calories, fat, carbs, protein }; } const data = [ createData('Frozen yoghurt', 159, 6.0, 24, 4.0), createData('Ice cream sandwich', 237, 9.0, 37, 4.3), createData('Eclair', 262, 16.0, 24, 6.0), createData('Cupcake', 305, 3.7, 67, 4.3), createData('Gingerbread', 356, 16.0, 49, 3.9), ]; function HoverTable(props) { const { classes } = props; return (
Nutrition
Dessert (100g serving) Calories Fat (g) Carbs (g) Protein (g) {data.map(n => ([ {n.name} {n.calories} {n.fat} {n.carbs} {n.protein} ]) )}
); } HoverTable.propTypes = { classes: PropTypes.object.isRequired, }; export default withStyles(styles)(HoverTable);