Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3718 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3719 stevensc 1
import React from 'react';
2
import { Box, Modal as MuiModal, IconButton } from '@mui/material';
3
import Close from '@mui/icons-material/Close';
4
 
5
import { useModal } from '@shared/hooks';
6
import { Card, CardHeader, CardContent } from './card';
7
 
8
export function Modal() {
9
  const { show, title, content, closeModal } = useModal();
10
 
11
  return (
12
    <MuiModal open={show} onClose={closeModal}>
13
      <Box
14
        sx={{
15
          position: 'fixed',
16
          top: '50%',
17
          left: '50%',
18
          transform: 'translate(-50%, -50%)',
19
          display: 'flex',
20
          justifyContent: 'center',
21
          alignItems: 'center',
22
          width: '100%',
23
          height: '100%'
24
        }}
25
      >
26
        <Card sx={{ width: '100%', maxWidth: { xs: '90vw', md: '500px' } }}>
27
          <CardHeader
28
            title={title}
29
            renderAction={() => (
30
              <IconButton onClick={closeModal}>
31
                <Close />
32
              </IconButton>
33
            )}
34
          />
35
          <CardContent styles={{ maxHeight: '70vh', overflowY: 'auto' }}>{content}</CardContent>
36
        </Card>
37
      </Box>
38
    </MuiModal>
39
  );
40
}