--- /dev/null
+import PropTypes from 'prop-types';
+import React from 'react';
+import { Alert, Button, Modal } from 'react-bootstrap';
+import { withTranslation } from 'react-i18next';
+
+import List from './List';
+import i18n from '../../i18n';
+
+class Dialog extends React.Component {
+
+ componentDidMount() {
+ this.timer = setInterval(() => {
+ this.forceUpdate();
+ }, 30000);
+ }
+
+ componentWillUnmount() {
+ clearInterval(this.timer);
+ }
+
+ render() {
+ const {
+ log,
+ onHide,
+ show,
+ } = this.props;
+ return <Modal className="chat-bot-log-dialog" onHide={onHide} show={show} size="lg">
+ <Modal.Header closeButton>
+ <Modal.Title>
+ {i18n.t('chatBotLog.heading')}
+ </Modal.Title>
+ </Modal.Header>
+ {log && log.length ?
+ <List log={log} />
+ :
+ <Modal.Body>
+ <Alert variant="info">
+ {i18n.t('chatBotLog.empty')}
+ </Alert>
+ </Modal.Body>
+ }
+ <Modal.Footer>
+ <Button onClick={onHide} variant="secondary">
+ {i18n.t('button.close')}
+ </Button>
+ </Modal.Footer>
+ </Modal>;
+ }
+
+}
+
+Dialog.propTypes = {
+ log: PropTypes.arrayOf(PropTypes.shape({
+ })),
+ onHide: PropTypes.func,
+ show: PropTypes.bool,
+};
+
+Dialog.defaultProps = {
+ log: null,
+ onHide: null,
+ show: false,
+};
+
+export default withTranslation()(Dialog);