CustomBotWithProxyIntegrationCard.jsx 3.0 KB

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