WordClockESP/interface/src/components/SectionContent.js

38 lines
928 B
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
2018-05-18 23:29:14 +01:00
import Paper from '@material-ui/core/Paper';
import { withStyles } from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
const styles = theme => ({
content: {
2019-06-02 19:01:06 +01:00
padding: theme.spacing(2),
2019-07-06 23:56:30 +01:00
margin: theme.spacing(3),
}
});
function SectionContent(props) {
2019-07-06 23:56:30 +01:00
const { children, classes, title, titleGutter } = props;
return (
<Paper className={classes.content}>
2019-07-06 23:56:30 +01:00
<Typography variant="h6" gutterBottom={titleGutter}>
{title}
</Typography>
{children}
</Paper>
);
}
SectionContent.propTypes = {
classes: PropTypes.object.isRequired,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node
]).isRequired,
2019-07-06 23:56:30 +01:00
title: PropTypes.string.isRequired,
titleGutter: PropTypes.bool
};
export default withStyles(styles)(SectionContent);