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 = ; break; case 'custom-bot-non-proxy': settingsComponent = ; break; case 'custom-bot-with-proxy': settingsComponent = ; break; } return ( <>

Access Token

Official Bot

This is a wider card with supporting text below as a natural lead-in to additional content.

handleBotTypeSelect('official-bot')} />
{settingsComponent} ); }; export default SlackIntegration;