X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fchat-bot-logs%2FDialog.js;fp=resources%2Fjs%2Fcomponents%2Fchat-bot-logs%2FDialog.js;h=ffe457cfbb704fefec01d7b974678bae27ec83db;hb=147c5f43c5d41fa18e82edb6651fe5a37c789353;hp=0000000000000000000000000000000000000000;hpb=ebdf8e5f6761de2abd85b01096a67dee62d7d4aa;p=alttp.git diff --git a/resources/js/components/chat-bot-logs/Dialog.js b/resources/js/components/chat-bot-logs/Dialog.js new file mode 100644 index 0000000..ffe457c --- /dev/null +++ b/resources/js/components/chat-bot-logs/Dialog.js @@ -0,0 +1,65 @@ +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 + + + {i18n.t('chatBotLog.heading')} + + + {log && log.length ? + + : + + + {i18n.t('chatBotLog.empty')} + + + } + + + + ; + } + +} + +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);