mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
20 lines
542 B
TypeScript
20 lines
542 B
TypeScript
import type {EventAttachment} from 'sentry/types';
|
|
import type {Event} from 'sentry/types/event';
|
|
|
|
export type ViewerProps = {
|
|
attachment: EventAttachment;
|
|
eventId: Event['id'];
|
|
orgId: string;
|
|
projectSlug: string;
|
|
className?: string;
|
|
};
|
|
|
|
export function getAttachmentUrl(props: ViewerProps, withPrefix?: boolean): string {
|
|
const {orgId, projectSlug, eventId, attachment} = props;
|
|
return `${
|
|
withPrefix ? '/api/0' : ''
|
|
}/projects/${orgId}/${projectSlug}/events/${eventId}/attachments/${
|
|
attachment.id
|
|
}/?download`;
|
|
}
|