1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button } from 'react-bootstrap';
4 import { useTranslation } from 'react-i18next';
6 import Icon from '../common/Icon';
14 const { t } = useTranslation();
16 const type = (settings && settings.command) || 'none';
20 <td>{t(`twitchBot.commandRestrictions.${(settings && settings.restrict) || 'none'}`)}</td>
21 <td>{t(`twitchBot.commandTypes.${type}`)}</td>
22 <td className="text-end">
23 <div className="button-bar">
26 onClick={() => onEditCommand(name, settings)}
27 title={t('button.edit')}
28 variant="outline-secondary"
30 <Icon.EDIT title="" />
35 onClick={() => onRemoveCommand(name)}
36 title={t('button.remove')}
37 variant="outline-danger"
39 <Icon.REMOVE title="" />
48 name: PropTypes.string,
49 onEditCommand: PropTypes.func,
50 onRemoveCommand: PropTypes.func,
51 settings: PropTypes.shape({
52 command: PropTypes.string,
53 restrict: PropTypes.string,
57 export default Command;