adminOrganizations.tsx 1.0 KB

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