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'; // project-imports import { ThemeMode } from 'config'; // ==============================|| CUSTOM - MAIN CARD ||============================== // const MainCard = forwardRef( ( { border = true, boxShadow, children, subheader, content = true, contentSX = {}, headerSX, darkTitle, divider = true, elevation, secondary, shadow, sx = {}, title, modal = false, ...others }, ref ) => { const theme = useTheme(); boxShadow = theme.palette.mode === ThemeMode.DARK ? boxShadow || true : boxShadow; return ( {/* card header and action */} {/* {!darkTitle && title && ( */} {!darkTitle && ( )} {darkTitle && title && ( {title || ''}} action={secondary} /> )} {/* content & header divider */} {title && divider && } {/* card content */} {content && ( {children} )} {!content && children} ); } ); MainCard.propTypes = { border: PropTypes.bool, boxShadow: PropTypes.bool, children: PropTypes.node, subheader: PropTypes.oneOfType([PropTypes.node, PropTypes.string]), content: PropTypes.bool, contentClass: PropTypes.string, contentSX: PropTypes.object, darkTitle: PropTypes.bool, divider: PropTypes.bool, elevation: PropTypes.number, secondary: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object]), shadow: PropTypes.string, sx: PropTypes.object, title: PropTypes.oneOfType([PropTypes.node, PropTypes.string, PropTypes.object]), modal: PropTypes.bool }; export default MainCard;