Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev Autor Línea Nro. Línea
6707 stevensc 1
import React, { useRef } from 'react'
2
import useOutsideClick from '../../hooks/useOutsideClick'
3
 
4
const ConfirmBox = ({ show, onClose, onAccept }) => {
5
  const confirmationBoxRef = useRef()
6708 stevensc 6
  useOutsideClick(confirmationBoxRef, () => onClose())
6707 stevensc 7
 
8
  return (
9
    <div
10
      className="popover confirmation fade bs-popover-top show"
11
      id="confirmation937427"
12
      style={{
13
        position: 'absolute',
14
        top: '-2.5rem',
15
        left: '50%',
16
        transform: 'translate(-50%, -100%)',
17
        width: '120px',
18
        display: show ? 'block' : 'none',
19
      }}
20
      ref={confirmationBoxRef}
21
    >
22
      <div className="arrow" style={{ left: '46px' }}></div>
23
      <p className="popover-header">¿Está seguro?</p>
24
      <div className="popover-body">
25
        <p className="confirmation-content" style={{ display: 'none' }}></p>
26
        <div className="confirmation-buttons text-center">
27
          <div className="btn-group">
28
            <button
29
              type="button"
30
              className="h-100 d-flex align-items-center btn btn-sm btn-primary"
31
              onClick={() => {
32
                onAccept()
33
                onClose()
34
              }}
35
            >
36
              Si
37
            </button>
38
            <button
39
              type="button"
40
              className="h-100 d-flex align-items-center btn btn-sm btn-secondary"
41
              onClick={() => {
42
                onClose()
43
              }}
44
            >
45
              No
46
            </button>
47
          </div>
48
        </div>
49
      </div>
50
    </div>
51
  )
52
}
53
 
54
export default ConfirmBox