import PropTypes from 'prop-types'; import { forwardRef } from 'react'; // material-ui import { useTheme } from '@mui/material/styles'; import { Card, CardContent, CardHeader, Divider, Typography } from '@mui/material'; // ==============================|| CUSTOM SUB CARD ||============================== // const SubCard = forwardRef( ({ children, content, contentClass, darkTitle, secondary, sx = {}, contentSX = {}, title, subTitle, ...others }, ref) => { const theme = useTheme(); return ( {/* card header and action */} {!darkTitle && title && ( {title}} action={secondary} subheader={subTitle} /> )} {darkTitle && title && ( {title}} action={secondary} subheader={subTitle} /> )} {/* content & header divider */} {title && ( )} {/* card content */} {content && ( {children} )} {!content && children} ); } ); SubCard.propTypes = { children: PropTypes.node, content: PropTypes.bool, contentClass: PropTypes.string, darkTitle: PropTypes.bool, secondary: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object]), sx: PropTypes.object, contentSX: PropTypes.object, title: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object]), subTitle: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object]) }; SubCard.defaultProps = { content: true }; export default SubCard;