groupEventAttachmentsTable.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import {t} from 'sentry/locale';
  2. import type {IssueAttachment} from 'sentry/types';
  3. import GroupEventAttachmentsTableRow from 'sentry/views/issueDetails/groupEventAttachments/groupEventAttachmentsTableRow';
  4. type Props = {
  5. attachments: IssueAttachment[];
  6. deletedAttachments: string[];
  7. groupId: string;
  8. onDelete: (attachmentId: string) => void;
  9. orgId: string;
  10. projectSlug: string;
  11. };
  12. function GroupEventAttachmentsTable({
  13. attachments,
  14. orgId,
  15. projectSlug,
  16. groupId,
  17. onDelete,
  18. deletedAttachments,
  19. }: Props) {
  20. const tableRowNames = [t('Name'), t('Type'), t('Size'), t('Actions')];
  21. return (
  22. <table className="table events-table">
  23. <thead>
  24. <tr>
  25. {tableRowNames.map(name => (
  26. <th key={name}>{name}</th>
  27. ))}
  28. </tr>
  29. </thead>
  30. <tbody>
  31. {attachments.map(attachment => (
  32. <GroupEventAttachmentsTableRow
  33. key={attachment.id}
  34. attachment={attachment}
  35. orgId={orgId}
  36. projectSlug={projectSlug}
  37. groupId={groupId}
  38. onDelete={onDelete}
  39. isDeleted={deletedAttachments.some(id => attachment.id === id)}
  40. />
  41. ))}
  42. </tbody>
  43. </table>
  44. );
  45. }
  46. export default GroupEventAttachmentsTable;