Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
928 B

  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import Paper from '@material-ui/core/Paper';
  4. import { withStyles } from '@material-ui/core/styles';
  5. import Typography from '@material-ui/core/Typography';
  6. const styles = theme => ({
  7. content: {
  8. padding: theme.spacing(2),
  9. margin: theme.spacing(3),
  10. }
  11. });
  12. function SectionContent(props) {
  13. const { children, classes, title, titleGutter } = props;
  14. return (
  15. <Paper className={classes.content}>
  16. <Typography variant="h6" gutterBottom={titleGutter}>
  17. {title}
  18. </Typography>
  19. {children}
  20. </Paper>
  21. );
  22. }
  23. SectionContent.propTypes = {
  24. classes: PropTypes.object.isRequired,
  25. children: PropTypes.oneOfType([
  26. PropTypes.arrayOf(PropTypes.node),
  27. PropTypes.node
  28. ]).isRequired,
  29. title: PropTypes.string.isRequired,
  30. titleGutter: PropTypes.bool
  31. };
  32. export default withStyles(styles)(SectionContent);