Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3717 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
3470 stevensc 1
import React from 'react';
3717 stevensc 2
import { Box, Modal as MuiModal, IconButton } from '@mui/material';
3
import Close from '@mui/icons-material/Close';
3470 stevensc 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}>
3526 stevensc 13
      <Box
14
        sx={{
3716 stevensc 15
          position: 'fixed',
3470 stevensc 16
          top: '50%',
17
          left: '50%',
3478 stevensc 18
          transform: 'translate(-50%, -50%)',
3526 stevensc 19
          display: 'flex',
20
          justifyContent: 'center',
3716 stevensc 21
          alignItems: 'center',
22
          width: '100%',
23
          height: '100%'
3470 stevensc 24
        }}
25
      >
3715 stevensc 26
        <Card styles={{ width: '100%', maxWidth: { xs: '90vw', md: '500px', lg: '800px' } }}>
3717 stevensc 27
          <CardHeader
28
            title={title}
3718 stevensc 29
            renderAction={() => (
3717 stevensc 30
              <IconButton onClick={closeModal}>
31
                <Close />
32
              </IconButton>
3718 stevensc 33
            )}
3717 stevensc 34
          />
3570 stevensc 35
          <CardContent styles={{ maxHeight: '70vh', overflowY: 'auto' }}>{content}</CardContent>
3526 stevensc 36
        </Card>
37
      </Box>
3470 stevensc 38
    </MuiModal>
39
  );
40
}