1 import axios from 'axios';
2 import PropTypes from 'prop-types';
3 import React, { useEffect, useState } from 'react';
4 import { Button } from 'react-bootstrap';
5 import { useTranslation } from 'react-i18next';
7 import Dialog from './Dialog';
8 import Icon from '../common/Icon';
10 const ChatBotLog = ({ id }) => {
11 const [showDialog, setShowDialog] = useState(false);
12 const [log, setLog] = useState([]);
14 const { t } = useTranslation();
17 if (!showDialog) return;
18 const ctrl = new AbortController();
20 .get(`/api/channels/${id}/chat-bot-log`, { signal: ctrl.signal })
22 setLog(response.data);
32 onClick={() => setShowDialog(true)}
33 title={t('button.protocol')}
34 variant="outline-info"
36 <Icon.PROTOCOL title="" />
40 onHide={() => setShowDialog(false)}
47 ChatBotLog.propTypes = {
51 export default ChatBotLog;