CustomBotWithProxyIntegrationCard.jsx 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import PropTypes from 'prop-types';
  4. const CustomBotWithProxyIntegrationCard = (props) => {
  5. const { t } = useTranslation();
  6. return (
  7. <div className="d-flex justify-content-center my-5 bot-integration">
  8. <div className="card rounded shadow border-0 w-50 admin-bot-card">
  9. <h5 className="card-title font-weight-bold mt-3 ml-4">Slack</h5>
  10. <div className="card-body px-5">
  11. {props.slackWSNameInWithProxy.length !== 0 && (
  12. <>
  13. {props.slackWSNameInWithProxy.map((slackWorkSpaceName) => {
  14. return (
  15. <div key={slackWorkSpaceName} className="card slack-work-space-name-card">
  16. <div className="m-2 text-center">
  17. <h5 className="font-weight-bold">{slackWorkSpaceName}</h5>
  18. <img width={20} height={20} src="/images/slack-integration/growi-bot-kun-icon.png" />
  19. </div>
  20. </div>
  21. );
  22. })}
  23. </>
  24. )}
  25. </div>
  26. </div>
  27. <div className="text-center w-25 mt-5">
  28. {props.isSlackScopeSet && (
  29. <p className="text-success small">
  30. <i className="fa fa-check mr-1" />
  31. {t('admin:slack_integration.integration_sentence.integration_successful')}
  32. </p>
  33. )}
  34. {!props.isSlackScopeSet && (
  35. <small
  36. className="text-secondary"
  37. // eslint-disable-next-line react/no-danger
  38. dangerouslySetInnerHTML={{ __html: t('admin:slack_integration.integration_sentence.integration_is_not_complete') }}
  39. />
  40. )}
  41. <div className="pt-2">
  42. <div className="position-relative mt-5">
  43. <div className="circle position-absolute bg-primary border-light">
  44. <p className="circle-inner text-light font-weight-bold">Proxy Server</p>
  45. </div>
  46. {props.isSlackScopeSet && (
  47. <hr className="align-self-center border-success admin-border-success"></hr>
  48. )}
  49. {!props.isSlackScopeSet && (
  50. <hr className="align-self-center border-danger admin-border-danger"></hr>
  51. )}
  52. </div>
  53. </div>
  54. </div>
  55. <div className="card rounded-lg shadow border-0 w-50 admin-bot-card">
  56. <div className="row">
  57. <h5 className="card-title font-weight-bold mt-3 ml-4 col">GROWI App</h5>
  58. <div className="pull-right mt-3 mr-3">
  59. <a className="icon-fw fa fa-repeat fa-2x"></a>
  60. </div>
  61. </div>
  62. <div className="card-body p-4 mb-5 text-center">
  63. <div className="btn-group-vertical">
  64. {props.siteNames.map((siteName) => {
  65. return <a key={siteName} className="btn btn-primary mb-3">{siteName}</a>
  66. })}
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. );
  72. };
  73. CustomBotWithProxyIntegrationCard.propTypes = {
  74. siteNames: PropTypes.array,
  75. slackWSNameInWithProxy: PropTypes.array,
  76. isSlackScopeSet: PropTypes.bool,
  77. };
  78. export default CustomBotWithProxyIntegrationCard;