import { ReactNode } from "react" // @mui material components import Card from "@mui/material/Card" import Grid from "@mui/material/Grid" import Icon from "@mui/material/Icon" // ThreeD Garden components import MDBox from "~/components/mui/MDBox" import MDTypography from "~/components/mui/MDTypography" // ThreeD Garden context import { useMaterialUIController } from "~/context" // Decalaring props types for MiniStatisticsCard interface Props { bgColor?: | "white" | "primary" | "secondary" | "info" | "success" | "warning" | "error" | "dark" title?: { fontWeight?: "light" | "regular" | "medium" | "bold" text?: string } count: string | number percentage?: { color: | "primary" | "secondary" | "info" | "success" | "warning" | "error" | "dark" | "white" text: string | number } icon: { color: | "primary" | "secondary" | "info" | "success" | "warning" | "error" | "dark" component: ReactNode } direction?: "right" | "left" [key: string]: any } function MiniStatisticsCard({ bgColor, title, count, percentage, icon, direction, }: Props): JSX.Element { const [controller] = useMaterialUIController() const { darkMode } = controller return ( ({ background: darkMode && background.card, })}> {direction === "left" ? ( {icon.component} ) : null} {title.text} {count}{" "} {percentage.text} {direction === "right" ? ( {icon.component} ) : null} ) } // Declaring default props for MiniStatisticsCard MiniStatisticsCard.defaultProps = { bgColor: "white", title: { fontWeight: "light", text: "", }, percentage: { color: "success", text: "", }, direction: "right", } export default MiniStatisticsCard