-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDelete.tsx
35 lines (32 loc) · 1.15 KB
/
Delete.tsx
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
27
28
29
30
31
32
33
34
35
import React from "react";
import { Modal, Button } from "react-bulma-components";
import { ContactType } from "../../../types";
interface DeleteModalProps {
type: ContactType;
contact: string;
show: boolean;
onDelete: () => void;
closeFunc: () => void;
}
const DeleteModal = function (props: DeleteModalProps) {
const { show, closeFunc, type, contact, onDelete } = props;
const prettyType = type === ContactType.Email ? "email" : "phone number";
return (
<Modal show={show} onClose={closeFunc}>
<Modal.Card>
<Modal.Card.Header onClose={closeFunc}>
<Modal.Card.Title>{`Remove ${prettyType}?`}</Modal.Card.Title>
</Modal.Card.Header>
<Modal.Card.Body>
{`You will no longer be able to use ${contact} with your account.`}
</Modal.Card.Body>
<Modal.Card.Footer>
<Button color="link" onClick={onDelete}>
Remove
</Button>
</Modal.Card.Footer>
</Modal.Card>
</Modal>
);
};
export default DeleteModal;