1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Alert, Button, Modal } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
6 import List from './List';
7 import i18n from '../../i18n';
9 class Dialog extends React.Component {
12 this.timer = setInterval(() => {
17 componentWillUnmount() {
18 clearInterval(this.timer);
27 return <Modal className="protocol-dialog" onHide={onHide} show={show} size="lg">
28 <Modal.Header closeButton>
30 {i18n.t('protocol.heading')}
33 {protocol && protocol.length ?
34 <List protocol={protocol} />
37 <Alert variant="info">
38 {i18n.t('protocol.empty')}
43 <Button onClick={onHide} variant="secondary">
44 {i18n.t('button.close')}
53 onHide: PropTypes.func,
54 protocol: PropTypes.arrayOf(PropTypes.shape({
55 type: PropTypes.string,
60 Dialog.defaultProps = {
66 export default withTranslation()(Dialog);