import { Theme } from '@mui/material/styles'; import { buttonClasses } from '@mui/material/Button'; // components import Iconify from 'src/components/iconify'; // ---------------------------------------------------------------------- const dateList = [ 'DatePicker', 'DateTimePicker', 'StaticDatePicker', 'DesktopDatePicker', 'DesktopDateTimePicker', // 'MobileDatePicker', 'MobileDateTimePicker', ]; const timeList = ['TimePicker', 'MobileTimePicker', 'StaticTimePicker', 'DesktopTimePicker']; const switchIcon = () => ; const leftIcon = () => ; const rightIcon = () => ; const calendarIcon = () => ; const clockIcon = () => ; const desktopTypes = dateList.reduce((result: Record, currentValue) => { result[`Mui${currentValue}`] = { defaultProps: { slots: { openPickerIcon: calendarIcon, leftArrowIcon: leftIcon, rightArrowIcon: rightIcon, switchViewIcon: switchIcon, }, }, }; return result; }, {}); const timeTypes = timeList.reduce((result: Record, currentValue) => { result[`Mui${currentValue}`] = { defaultProps: { slots: { openPickerIcon: clockIcon, rightArrowIcon: rightIcon, switchViewIcon: switchIcon, }, }, }; return result; }, {}); export function datePicker(theme: Theme) { return { MuiPickersLayout: { styleOverrides: { root: { '& .MuiPickersLayout-actionBar': { [`& .${buttonClasses.root}:last-of-type`]: { backgroundColor: theme.palette.text.primary, color: theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[800], }, }, }, }, }, // Date ...desktopTypes, // Time ...timeTypes, }; }