mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
64 lines
1.6 KiB
TypeScript
64 lines
1.6 KiB
TypeScript
import {Sql} from 'sentry/components/events/interfaces/breadcrumbs/breadcrumb/data/sql';
|
|
import type {
|
|
BreadcrumbMeta,
|
|
BreadcrumbTransactionEvent,
|
|
} from 'sentry/components/events/interfaces/breadcrumbs/types';
|
|
import type {Organization} from 'sentry/types';
|
|
import type {RawCrumb} from 'sentry/types/breadcrumbs';
|
|
import {BreadcrumbMessageFormat, BreadcrumbType} from 'sentry/types/breadcrumbs';
|
|
import type {Event} from 'sentry/types/event';
|
|
|
|
import {Default} from './default';
|
|
import {Exception} from './exception';
|
|
import {Http} from './http';
|
|
|
|
type Props = {
|
|
breadcrumb: RawCrumb;
|
|
event: Event;
|
|
organization: Organization;
|
|
searchTerm: string;
|
|
meta?: BreadcrumbMeta;
|
|
transactionEvents?: BreadcrumbTransactionEvent[];
|
|
};
|
|
|
|
export function Data({
|
|
breadcrumb,
|
|
event,
|
|
organization,
|
|
searchTerm,
|
|
meta,
|
|
transactionEvents,
|
|
}: Props) {
|
|
const orgSlug = organization.slug;
|
|
|
|
if (breadcrumb.type === BreadcrumbType.HTTP) {
|
|
return <Http breadcrumb={breadcrumb} searchTerm={searchTerm} meta={meta} />;
|
|
}
|
|
|
|
if (
|
|
!meta &&
|
|
breadcrumb.message &&
|
|
breadcrumb.messageFormat === BreadcrumbMessageFormat.SQL
|
|
) {
|
|
return <Sql breadcrumb={breadcrumb} searchTerm={searchTerm} />;
|
|
}
|
|
|
|
if (
|
|
breadcrumb.type === BreadcrumbType.WARNING ||
|
|
breadcrumb.type === BreadcrumbType.ERROR
|
|
) {
|
|
return <Exception breadcrumb={breadcrumb} searchTerm={searchTerm} meta={meta} />;
|
|
}
|
|
|
|
return (
|
|
<Default
|
|
event={event}
|
|
orgSlug={orgSlug}
|
|
breadcrumb={breadcrumb}
|
|
searchTerm={searchTerm}
|
|
meta={meta}
|
|
transactionEvents={transactionEvents}
|
|
/>
|
|
);
|
|
}
|