import {Component} from 'react'; import styled from '@emotion/styled'; import {Client} from 'sentry/api'; import Button from 'sentry/components/button'; import ButtonBar from 'sentry/components/buttonBar'; import Confirm from 'sentry/components/confirm'; import {IconDelete, IconDownload, IconShow} from 'sentry/icons'; import {t} from 'sentry/locale'; import space from 'sentry/styles/space'; import withApi from 'sentry/utils/withApi'; type Props = { api: Client; attachmentId: string; onDelete: (attachmentId: string) => void; url: string | null; hasPreview?: boolean; onPreview?: (attachmentId: string) => void; previewIsOpen?: boolean; withPreviewButton?: boolean; }; class EventAttachmentActions extends Component { handlePreview() { const {onPreview, attachmentId} = this.props; if (onPreview) { onPreview(attachmentId); } } render() { const {url, withPreviewButton, hasPreview, previewIsOpen, onDelete, attachmentId} = this.props; return ( onDelete(attachmentId)} disabled={!url} >