zhongrj
2025-11-24 276323dce9613867abb3f58a4cc2abbfb2fd0dea
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 PropTypes from 'prop-types';
import { Component } from "react";
import { Modal } from "react-bootstrap";
import "./ErrorDialog.scss";
 
export default class ErrorDialog extends Component {
    static propTypes = {
        errorMessage: PropTypes.string.isRequired,
  }
    
    constructor(props){
        super(props);
 
        this.state = { show: true };
    }
    
    handleOnHide = () => this.setState({show: false});
    
    render() {
        const { errorMessage } = this.props;
        
        return (
            <Modal show={this.state.show}>
                <Modal.Header closeButton onHide={this.handleOnHide}>
                    <Modal.Title>
                        There was an error with Cloud Import :(
                    </Modal.Title>
                </Modal.Header>
                <Modal.Body>
                    { errorMessage }
                </Modal.Body>
            </Modal>
        );
    }
}