import React, { Ref } from 'react'; // material-ui import { useTheme } from '@mui/material/styles'; import { Card, CardContent, CardHeader, Divider, Typography, CardProps, CardHeaderProps, CardContentProps } from '@mui/material'; // project imports import { KeyedObject } from 'types'; // constant const headerSX = { '& .MuiCardHeader-action': { mr: 0 } }; // ==============================|| CUSTOM MAIN CARD ||============================== // export interface MainCardProps extends KeyedObject { border?: boolean; boxShadow?: boolean; children: React.ReactNode | string; style?: React.CSSProperties; content?: boolean; className?: string; contentClass?: string; contentSX?: CardContentProps['sx']; darkTitle?: boolean; sx?: CardProps['sx']; secondary?: CardHeaderProps['action']; shadow?: string; elevation?: number; title?: React.ReactNode | string; } const MainCard = React.forwardRef( ( { border = true, boxShadow, children, content = true, contentClass = '', contentSX = {}, darkTitle, secondary, shadow, sx = {}, title, ...others }: MainCardProps, ref: Ref ) => { const theme = useTheme(); return ( {/* card header and action */} {!darkTitle && title && } {darkTitle && title && ( {title}} action={secondary} /> )} {/* content & header divider */} {title && } {/* card content */} {content && ( {children} )} {!content && children} ); } ); export default MainCard;