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 handleBotTypeSelect = (clickedBotType) => { if (clickedBotType === currentBotType) { return; } if (currentBotType === null) { setCurrentBotType(clickedBotType); return; } setSelectedBotType(clickedBotType); }; const handleCancelBotChange = () => { setSelectedBotType(null); }; const changeCurrentBotSettings = () => { setCurrentBotType(selectedBotType); setSelectedBotType(null); }; let settingsComponent = null; switch (currentBotType) { case 'official-bot': settingsComponent = ; break; case 'custom-bot-without-proxy': settingsComponent = ; break; case 'custom-bot-with-proxy': settingsComponent = ; break; } return ( <>

Access Token

handleBotTypeSelect('official-bot')} >
Official Bot

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

handleBotTypeSelect('custom-bot-without-proxy')} >
Custom Bot (Without Proxy)

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

handleBotTypeSelect('custom-bot-with-proxy')} >
Custom Bot (With Proxy)

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

{settingsComponent} ); }; export default SlackIntegration;