import React from 'react'; import PropTypes from 'prop-types'; import { Backdrop, CircularProgress } from '@mui/material'; import { alpha } from '@mui/system'; const CustomBackdrop = ({ position = 'fixed', isLoading }) => ( alpha(palette.background.default, palette.action.disabledOpacity), zIndex: ({ zIndex }) => zIndex.drawer + 1, }} open={isLoading} > ); CustomBackdrop.propTypes = { position: PropTypes.oneOf(['fixed', 'absolute']), isLoading: PropTypes.bool.isRequired, }; export default CustomBackdrop;