forked from 4GeeksAcademy/react-hello-webapp-deprecated
-
Notifications
You must be signed in to change notification settings - Fork 974
Expand file tree
/
Copy pathmodalDelete.jsx
More file actions
26 lines (24 loc) · 1.27 KB
/
modalDelete.jsx
File metadata and controls
26 lines (24 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import useGlobalReducer from "../hooks/useGlobalReducer"
import { borrarContacto } from "../store"
export const ModalDelete = ({ id, name }) => {
const { store, dispatch } = useGlobalReducer()
return (
<div className="modal fade" id="exampleModal" tabIndex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div className="modal-dialog">
<div className="modal-content">
<div className="modal-header">
<h1 className="modal-title fs-5" id="exampleModalLabel">Eliminar Contacto</h1>
<button type="button" className="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div className="modal-body">
Estas seguro que desea borrar a {name} de contactos?
</div>
<div className="modal-footer">
<button type="button" className="btn btn-secondary" data-bs-dismiss="modal">cancelar</button>
<button type="button" className="btn btn-danger" data-bs-dismiss="modal" onClick={() => borrarContacto(dispatch, id)}>borrar</button>
</div>
</div>
</div>
</div>
)
}