1 import React from 'react';
2 import { Col, Form, Row } from 'react-bootstrap';
3 import { useTranslation } from 'react-i18next';
5 import DiscordChannelSelect from '../common/DiscordChannelSelect';
6 import DiscordSelect from '../common/DiscordSelect';
8 const Controls = () => {
9 const [channel, setChannel] = React.useState('');
10 const [guild, setGuild] = React.useState(null);
12 const { t } = useTranslation();
16 <Form.Group as={Col} md={6}>
17 <Form.Label>{t('discordBot.guild')}</Form.Label>
20 onChange={({ guild }) => { setGuild(guild); setChannel(''); }}
21 value={guild ? guild.guild_id : ''}
24 <Form.Group as={Col} md={6}>
25 <Form.Label>{t('discordBot.channel')}</Form.Label>
28 as={DiscordChannelSelect}
29 guild={guild.guild_id}
30 onChange={({ target: { value } }) => setChannel(value)}
35 <Form.Control plaintext readOnly defaultValue={t('discordBot.selectGuild')} />
42 export default Controls;