SlackIntegration.jsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import AccessTokenSettings from './AccessTokenSettings';
  4. import OfficialBotSettings from './CustomBotNonProxySettings';
  5. import CustomBotNonProxySettings from './CustomBotNonProxySettings';
  6. import CustomBotWithProxySettings from './CustomBotWithProxySettings';
  7. const SlackIntegration = () => {
  8. const handleBotTypeSelect = (e) => {
  9. console.log(e.target.value);
  10. };
  11. // const selectedBotType = 'official-bot';
  12. const selectedBotType = 'custom-bot-non-proxy';
  13. // const selectedBotType = 'custom-bot-with-proxy';
  14. let settingsComponent = '';
  15. switch (selectedBotType) {
  16. case 'custom-bot-non-proxy':
  17. settingsComponent = <CustomBotNonProxySettings />;
  18. break;
  19. case 'custom-bot-with-proxy':
  20. settingsComponent = <CustomBotWithProxySettings />;
  21. break;
  22. default:
  23. settingsComponent = <OfficialBotSettings />;
  24. break;
  25. }
  26. return (
  27. <>
  28. <div className="row">
  29. <div className="col-lg-12">
  30. <h2 className="admin-setting-header">Access Token</h2>
  31. <AccessTokenSettings />
  32. </div>
  33. </div>
  34. <div className="row my-5">
  35. <div className="mx-auto form-check" onChange={handleBotTypeSelect}>
  36. <div className="form-check-inline">
  37. <input className="form-check-input" type="radio" id="checkbox1" value="official-bot" />
  38. <label className="form-check-label" htmlFor="checkbox1">Official Bot</label>
  39. </div>
  40. <div className="form-check-inline">
  41. <input className="form-check-input" type="radio" id="checkbox2" value="custom-bot-non-proxy" />
  42. <label className="form-check-label" htmlFor="checkbox2">Custom Bot (Non Proxy)</label>
  43. </div>
  44. <div className="form-check-inline">
  45. <input className="form-check-input" type="radio" id="checkbox3" value="custom-bot-with-proxy" />
  46. <label className="form-check-label" htmlFor="checkbox3">Custom Bot (With Proxy)</label>
  47. </div>
  48. </div>
  49. </div>
  50. {settingsComponent}
  51. </>
  52. );
  53. }
  54. export default SlackIntegration;