import React, { useState } from 'react';
import AccessTokenSettings from './AccessTokenSettings';
import OfficialBotSettings from './OfficialBotSettings';
import CustomBotWithoutProxySettings from './CustomBotWithoutProxySettings';
import CustomBotWithProxySettings from './CustomBotWithProxySettings';
import ConfirmBotChangeModal from './ConfirmBotChangeModal';
const SlackIntegration = () => {
const [currentBotType, setcurrentBotType] = useState(null);
const [selectedBotType, setSelectedBotType] = useState(null);
const [modalVisibility, setmodalVisibility] = useState(false);
const handleBotTypeSelect = (clickedBotType) => {
if (clickedBotType === currentBotType) {
return;
}
setSelectedBotType(clickedBotType);
setmodalVisibility(true);
};
const handleBotChangeCancel = () => {
setSelectedBotType(null);
setmodalVisibility(false);
};
const changeCurrentBotSettings = () => {
setcurrentBotType(selectedBotType);
setSelectedBotType(null);
setmodalVisibility(false);
};
let settingsComponent = null;
switch (currentBotType) {
case 'official-bot':
settingsComponent =
This is a wider card with supporting text below as a natural lead-in to additional content.
handleBotTypeSelect('official-bot')} />This is a wider card with supporting text below as a natural lead-in to additional content.
handleBotTypeSelect('custom-bot-non-proxy')} />This is a wider card with supporting text below as a natural lead-in to additional content.
handleBotTypeSelect('custom-bot-with-proxy')} />