Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev Autor Línea Nro. Línea
5070 stevensc 1
import React from 'react'
2
import Button from 'react-bootstrap/Button'
3
import Modal from 'react-bootstrap/Modal'
4
import Spinner from '../loading-spinner/Spinner'
5468 stevensc 5
import { useSelector } from 'react-redux'
1 www 6
 
5468 stevensc 7
const ConfirmModal = ({
8
  show = false,
9
  title = '¿Estás seguro?',
10
  message = '',
6765 stevensc 11
  loading = false,
5468 stevensc 12
  onClose = () => null,
13
  onAccept = () => null,
14
}) => {
7245 stevensc 15
  const labels = useSelector(({ labels }) => labels)
1 www 16
 
17
  return (
5499 stevensc 18
    <Modal size="sm" show={show} onHide={onClose}>
5468 stevensc 19
      <Modal.Header closeButton>
20
        <Modal.Title>{title}</Modal.Title>
21
      </Modal.Header>
22
      <Modal.Body>
23
        {message && <p>{message}</p>}
24
        {loading && <Spinner />}
25
      </Modal.Body>
26
      <Modal.Footer>
27
        <Button size="lg" type="submit" onClick={onAccept}>
6765 stevensc 28
          {labels.accept}
5468 stevensc 29
        </Button>
30
        <Button size="lg" onClick={onClose}>
6765 stevensc 31
          {labels.cancel}
5468 stevensc 32
        </Button>
33
      </Modal.Footer>
34
    </Modal>
5070 stevensc 35
  )
36
}
1 www 37
 
5070 stevensc 38
export default ConfirmModal