codekingpro/portable-devtools
114k
1import { makeStyles } from '@mui/styles';2import React from 'react';3import clsx from 'clsx';4import PropTypes from 'prop-types';5import CustomPropTypes from '../custom_prop_types';6 7const useStyles = makeStyles((theme)=>({8 fieldset: {9 padding: theme.spacing(0.5),10 borderRadius: theme.shape.borderRadius,11 backgroundColor: 'inherit',12 border: '1px solid ' + theme.otherVars.borderColor,13 },14 legend: {15 width: 'unset',16 fontSize: 'inherit',17 fontWeight: 'bold',18 }19}));20 21export default function FieldSet({title='', className, children}) {22 const classes = useStyles();23 return (24 <fieldset className={clsx(classes.fieldset, className)}>25 <legend className={classes.legend}>{title}</legend>26 {children}27 </fieldset>28 );29}30 31FieldSet.propTypes = {32 title: PropTypes.string,33 className: CustomPropTypes.className,34 children: CustomPropTypes.children,35};36 