// ** MUI Imports import Box from '@mui/material/Box' import Grid from '@mui/material/Grid' import Radio from '@mui/material/Radio' import Image from 'next/image' // ** Type Imports import { CustomRadioImgProps } from 'src/@core/components/custom-radio/types' const CustomRadioImg = (props: CustomRadioImgProps) => { // ** Props const { name, data, selected, gridProps, handleChange, color = 'primary' } = props const { alt, img, value } = data const renderComponent = () => { return ( handleChange(value)} sx={{ height: '100%', display: 'flex', borderRadius: 1, cursor: 'pointer', overflow: 'hidden', position: 'relative', alignItems: 'center', flexDirection: 'column', justifyContent: 'center', border: theme => `2px solid ${theme.palette.divider}`, ...(selected === value ? { borderColor: `${color}.main` } : { '&:hover': { borderColor: theme => `rgba(${theme.palette.customColors.main}, 0.25)` } }), '& img': { width: '100%', height: '100%', objectFit: 'cover' } }} > {typeof img === 'string' ? {alt : img} ) } return data ? renderComponent() : null } export default CustomRadioImg