import * as React from 'react' import { Box, Card, CardContent, IconButton, Typography } from '@mui/material' import { useTheme } from '@mui/material/styles' import EastIcon from '@mui/icons-material/East' interface StatsCardProps { icon: React.ReactNode title: string count?: string | number errorMsg?: Error | string onClick?: () => void color?: string } export const StatsCard: FCWithChildren = ({ icon, title, count, onClick, errorMsg, color: colorProp, }) => { const theme = useTheme() const color = colorProp || theme.palette.text.primary return ( {icon} {count === undefined || count === null ? '' : count} {title} {errorMsg && ( {typeof errorMsg === 'string' ? errorMsg : errorMsg.message || 'Oh no! An error occurred'} )} ) }