import { ArrowOutward, SouthEast } from '@mui/icons-material'; import { Box, Typography, styled } from '@mui/material'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { flexRow } from 'themes/themeStyles'; const StyledBox = styled(Box)(({ theme }) => ({ padding: theme.spacing(4, 2), backgroundColor: theme.palette.background.paper, minWidth: '24%', display: 'flex', flexDirection: 'column', alignItems: 'center', borderRadius: `${theme.shape.borderRadiusLarge}px`, [theme.breakpoints.down('lg')]: { minWidth: '49%', padding: theme.spacing(2), ':nth-child(n+3)': { marginTop: theme.spacing(2), }, }, [theme.breakpoints.down('sm')]: { ':nth-child(n+2)': { marginTop: theme.spacing(2), }, }, })); const StyledTypographyHeader = styled(Typography)(({ theme }) => ({ marginBottom: theme.spacing(2), })); const StyledTypographyCount = styled(Typography)(({ theme }) => ({ fontSize: theme.fontSizes.largeHeader, fontWeight: 'bold', })); const StyledBoxChangeContainer = styled(Box)(({ theme }) => ({ ...flexRow, flexDirection: 'column', alignItems: 'center', marginLeft: theme.spacing(1.5), })); const StyledTypographySubtext = styled(Typography)(({ theme }) => ({ color: theme.palette.neutral.main, fontSize: theme.fontSizes.smallBody, })); const StyledTypographyChange = styled(Typography)(({ theme }) => ({ marginLeft: theme.spacing(1), fontSize: theme.fontSizes.smallBody, })); interface IStatusBoxProps { title: string; boxText: string; change: number; percentage?: boolean; } const resolveIcon = (change: number) => { if (change > 0) { return ( ); } return ; }; const resolveColor = (change: number) => { if (change > 0) { return 'success.main'; } return 'error.main'; }; export const StatusBox = ({ title, boxText, change, percentage, }: IStatusBoxProps) => { return ( {title} {boxText} {resolveIcon(change)} {change} {percentage ? '%' : ''} this month } elseShow={ No change } /> ); };