File size: 1,353 Bytes
803d869
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React from "react";

const ErrorPopup = ({ message, onClose }) => {
  if (!message) return null;

  return (
    <>

      <style>{`

        .error-popup-overlay {

          position: fixed;

          top: 0;

          left: 0;

          width: 100%;

          height: 100%;

          background: rgba(0,0,0,0.4);

          display: flex;

          align-items: center;

          justify-content: center;

          z-index: 999;

        }



        .error-popup {

          background: white;

          padding: 20px 30px;

          border-radius: 10px;

          max-width: 400px;

          text-align: center;

          box-shadow: 0 0 20px rgba(0,0,0,0.3);

        }



        .error-popup button {

          margin-top: 15px;

          background-color: #dc3545;

          color: white;

          border: none;

          padding: 8px 16px;

          border-radius: 8px;

          cursor: pointer;

        }



        .error-popup button:hover {

          background-color: #c82333;

        }

      `}</style>



      <div className="error-popup-overlay">

        <div className="error-popup">

          <h3>⚠️ Something went wrong</h3>

          <p>{message}</p>

          <button onClick={onClose}>Close</button>

        </div>

      </div>

    </>
  );
};

export default ErrorPopup;