-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathPaymentModal.tsx
More file actions
42 lines (38 loc) · 897 Bytes
/
PaymentModal.tsx
File metadata and controls
42 lines (38 loc) · 897 Bytes
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
36
37
38
39
40
41
42
import React from "react";
interface ModalContent {
title: string;
message: string;
}
interface PaymentModalProps {
content: ModalContent;
onClose: () => void;
}
const PaymentModal: React.FC<PaymentModalProps> = ({ content, onClose }) => {
return (
<div
className="modal-overlay"
onClick={onClose}
role="dialog"
aria-modal="true"
aria-labelledby="modal-title"
data-testid="payment-modal"
>
<div className="modal-content">
<button
className="close-button"
onClick={(e) => {
e.stopPropagation();
onClose();
}}
aria-label="Close modal"
data-testid="modal-close-button"
>
×
</button>
<h2 id="modal-title">{content.title}</h2>
<p>{content.message}</p>
</div>
</div>
);
};
export default PaymentModal;