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 import import Highlighter from './third-party/Highlighter'; // header style const headerSX = { p: 2.5, '& .MuiCardHeader-action': { m: '0px auto', alignSelf: 'center' } }; // ==============================|| CUSTOM - MAIN CARD ||============================== // const MainCard = forwardRef( ( { border = true, boxShadow, children, content = true, contentSX = {}, darkTitle, elevation, secondary, shadow, sx = {}, title, codeHighlight, ...others }, ref ) => { const theme = useTheme(); boxShadow = theme.palette.mode === 'dark' ? boxShadow || true : boxShadow; return ( {/* card header and action */} {!darkTitle && title && ( )} {darkTitle && title && {title}} action={secondary} />} {/* card content */} {content && {children}} {!content && children} {/* card footer - clipboard & highlighter */} {codeHighlight && ( <> {children} )} ); } ); MainCard.propTypes = { border: PropTypes.bool, boxShadow: PropTypes.bool, contentSX: PropTypes.object, darkTitle: PropTypes.bool, divider: PropTypes.bool, elevation: PropTypes.number, secondary: PropTypes.node, shadow: PropTypes.string, sx: PropTypes.object, title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), codeHighlight: PropTypes.bool, content: PropTypes.bool, children: PropTypes.node }; export default MainCard;