CSE316/hw2/src/components/DeleteModal.js
2022-05-23 06:22:34 -04:00

36 lines
1.2 KiB
JavaScript

import React, { Component } from 'react';
export default class DeleteModal extends Component {
render() {
const { listKeyPair, hideDeleteListModalCallback, deleteListCallback } = this.props;
let name = "";
if (listKeyPair) {
name = listKeyPair.name;
}
return (
<div
className="modal"
id="delete-modal"
data-animation="slideInOutLeft">
<div className="modal-dialog">
<header className="dialog-header">
Delete the {name} Top 5 List?
</header>
<div id="confirm-cancel-container">
<button
id="dialog-yes-button"
className="modal-button"
onClick={deleteListCallback}
>Confirm</button>
<button
id="dialog-no-button"
className="modal-button"
onClick={hideDeleteListModalCallback}
>Cancel</button>
</div>
</div>
</div>
);
}
}