AdminWorkspace.jsx 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import React from 'react'
  2. import { translate } from 'react-i18next'
  3. import {
  4. Delimiter,
  5. PageWrapper,
  6. PageTitle,
  7. PageContent
  8. } from 'tracim_frontend_lib'
  9. const AdminWorkspace = props =>
  10. <PageWrapper customClass='adminWorkspacePage'>
  11. <PageTitle
  12. parentClass={'adminWorkspacePage'}
  13. title={'Workspace management'}
  14. />
  15. <PageContent parentClass='adminWorkspacePage'>
  16. <div className='adminWorkspacePage__description'>
  17. {props.t('List of every workspaces')}
  18. </div>
  19. <Delimiter customClass={'adminWorkspacePage__delimiter'} />
  20. <div className='adminWorkspacePage__workspaceTable'>
  21. <table className='table'>
  22. <thead>
  23. <tr>
  24. <th scope='col'>Id</th>
  25. <th scope='col'>{props.t('Workspace')}</th>
  26. <th scope='col'>{props.t('Description')}</th>
  27. <th scope='col'>{props.t('Member count')}</th>
  28. {/* <th scope='col'>Calendar</th> */}
  29. <th scope='col'>{props.t('Delete workspace')}</th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. {props.workspaceList/* .sort((a, b) => a.workspace_id > b.workspace_id) */.map(ws =>
  34. <tr key={ws.slug}>
  35. <th>{ws.workspace_id}</th>
  36. <td>{ws.label}</td>
  37. <td>"(nyi) blocked by backend"</td>
  38. {/*
  39. <td className='d-flex align-items-center flex-wrap'>
  40. <div className='adminWorkspacePage__workspaceTable__calendaricon mr-2'>
  41. <i className='fa fa-fw fa-check-square-o' />
  42. </div>
  43. Enable
  44. </td>
  45. */}
  46. <td>{ws.memberList.length}</td>
  47. <td>
  48. <div className='adminWorkspacePage__table__delete primaryColorFont primaryColorFontDarkenHover'>
  49. <button
  50. type='button'
  51. className='adminWorkspacePage__table__delete__icon btn mr-3'
  52. onClick={() => props.onClickDeleteWorkspace(ws.workspace_id)}
  53. >
  54. <i className='fa fa-fw fa-trash-o' />
  55. </button>
  56. </div>
  57. </td>
  58. </tr>
  59. )}
  60. </tbody>
  61. </table>
  62. </div>
  63. </PageContent>
  64. </PageWrapper>
  65. export default translate()(AdminWorkspace)