import React, { ReactNode, Ref } from 'react'; // material-ui import { useTheme } from '@mui/material/styles'; import { Card, CardContent, CardHeader, Divider, Typography } from '@mui/material'; export interface SubCardProps { children: ReactNode | string | null; content?: boolean; className?: string; contentClass?: string; darkTitle?: boolean; secondary?: ReactNode | string | {}; sx?: {}; contentSX?: {}; title?: ReactNode | string | {}; } // ==============================|| CUSTOM SUB CARD ||============================== // const SubCard = React.forwardRef( ( { children, className, content, contentClass, darkTitle, secondary, sx = {}, contentSX = {}, title, ...others }: SubCardProps, ref: Ref ) => { const theme = useTheme(); return ( {/* card header and action */} {!darkTitle && title && ( {title}} action={secondary} /> )} {darkTitle && title && ( {title}} action={secondary} /> )} {/* content & header divider */} {title && ( )} {/* card content */} {content && ( {children} )} {!content && children} ); } ); SubCard.defaultProps = { content: true }; export default SubCard;