// @mui material components import Card from "@mui/material/Card" import Icon from "@mui/material/Icon" // ThreeD Garden components import MDBox from "~/components/mui/MDBox" import MDTypography from "~/components/mui/MDTypography" // Images import pattern from "~/assets/images/illustrations/pattern-tree.svg" import masterCardLogo from "~/assets/images/logos/mastercard.png" interface Props { color?: | "primary" | "secondary" | "info" | "success" | "warning" | "error" | "dark" number: number holder: string expires: string [key: string]: any } function MasterCard({ color, number, holder, expires }: Props): JSX.Element { const numbers: string[] = [...`${number}`] if (numbers.length < 16 || numbers.length > 16) { throw new Error( "Invalid value for the prop number, the value for the number prop shouldn't be greater than or less than 16 digits" ) } const num1 = numbers.slice(0, 4).join("") const num2 = numbers.slice(4, 8).join("") const num3 = numbers.slice(8, 12).join("") const num4 = numbers.slice(12, 16).join("") return ( ({ background: gradients[color] ? linearGradient(gradients[color].main, gradients[color].state) : linearGradient(gradients.dark.main, gradients.dark.state), boxShadow: xl, position: "relative", })}> wifi {num1}  {num2}  {num3}  {num4} Card Holder {holder} Expires {expires} ) } // Declaring default props for MasterCard MasterCard.defaultProps = { color: "dark", } export default MasterCard