adminOrganizations.tsx 962 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {Link, RouteComponentProps} from 'react-router';
  2. import ResultGrid from 'app/components/resultGrid';
  3. import {t} from 'app/locale';
  4. type Props = RouteComponentProps<{}, {}>;
  5. const getRow = (row: any) => [
  6. <td key={row.id}>
  7. <strong>
  8. <Link to={`/${row.slug}/`}>{row.name}</Link>
  9. </strong>
  10. <br />
  11. <small>{row.slug}</small>
  12. </td>,
  13. ];
  14. const AdminOrganizations = (props: Props) => (
  15. <div>
  16. <h3>{t('Organizations')}</h3>
  17. <ResultGrid
  18. path="/manage/organizations/"
  19. endpoint="/organizations/?show=all"
  20. method="GET"
  21. columns={[<th key="column-org">Organization</th>]}
  22. columnsForRow={getRow}
  23. hasSearch
  24. sortOptions={[
  25. ['date', 'Date Joined'],
  26. ['members', 'Members'],
  27. ['events', 'Events'],
  28. ['projects', 'Projects'],
  29. ['employees', 'Employees'],
  30. ]}
  31. defaultSort="date"
  32. {...props}
  33. />
  34. </div>
  35. );
  36. export default AdminOrganizations;