eventsTable.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import {Component} from 'react';
  2. import EventsTableRow from 'sentry/components/eventsTable/eventsTableRow';
  3. import {t} from 'sentry/locale';
  4. import {Tag} from 'sentry/types';
  5. import {Event} from 'sentry/types/event';
  6. type Props = {
  7. events: Event[];
  8. groupId: string;
  9. orgId: string;
  10. projectId: string;
  11. tagList: Tag[];
  12. };
  13. class EventsTable extends Component<Props> {
  14. render() {
  15. const {events, tagList, orgId, projectId, groupId} = this.props;
  16. const hasUser = !!events.find(event => event.user);
  17. return (
  18. <table className="table events-table">
  19. <thead>
  20. <tr>
  21. <th>{t('ID')}</th>
  22. {hasUser && <th>{t('User')}</th>}
  23. {tagList.map(tag => (
  24. <th key={tag.key}>{tag.name}</th>
  25. ))}
  26. </tr>
  27. </thead>
  28. <tbody>
  29. {events.map(event => (
  30. <EventsTableRow
  31. key={event.id}
  32. event={event}
  33. orgId={orgId}
  34. projectId={projectId}
  35. groupId={groupId}
  36. tagList={tagList}
  37. hasUser={hasUser}
  38. />
  39. ))}
  40. </tbody>
  41. </table>
  42. );
  43. }
  44. }
  45. export default EventsTable;