import type { Theme } from '@mui/material';
import { backdropClasses } from '@mui/material';
import type { Components } from '@mui/material/styles';
import { alpha } from '@mui/material/styles';

import { ALPHA_800 } from '@/mui/constants/opacity';

export default function MuiBackdrop(theme: Theme): Components['MuiBackdrop'] {
  return {
    styleOverrides: {
      root: {
        background: alpha(theme.palette.common.black, ALPHA_800),

        [`&.${backdropClasses.invisible}`]: {
          background: 'transparent',
        },
      },
    },
  };
}
