mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import ClippedBox from 'sentry/components/clippedBox';
|
|
import ErrorBoundary from 'sentry/components/errorBoundary';
|
|
import {EventDataSection} from 'sentry/components/events/eventDataSection';
|
|
import KeyValueList from 'sentry/components/events/interfaces/keyValueList';
|
|
import {t} from 'sentry/locale';
|
|
import type {Event} from 'sentry/types/event';
|
|
import {objectIsEmpty} from 'sentry/utils';
|
|
|
|
type Props = {
|
|
event: Event;
|
|
};
|
|
|
|
export function EventPackageData({event}: Props) {
|
|
let longKeys: boolean, title: string;
|
|
|
|
const packages = Object.entries(event.packages || {}).map(([key, value]) => ({
|
|
key,
|
|
value,
|
|
subject: key,
|
|
meta: event._meta?.packages?.[key]?.[''],
|
|
}));
|
|
|
|
switch (event.platform) {
|
|
case 'csharp':
|
|
longKeys = true;
|
|
title = t('Assemblies');
|
|
break;
|
|
case 'java':
|
|
longKeys = true;
|
|
title = t('Dependencies');
|
|
break;
|
|
default:
|
|
longKeys = false;
|
|
title = t('Packages');
|
|
}
|
|
|
|
if (objectIsEmpty(event.packages)) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<EventDataSection type="packages" title={title}>
|
|
<ClippedBox>
|
|
<ErrorBoundary mini>
|
|
<KeyValueList data={packages} longKeys={longKeys} />
|
|
</ErrorBoundary>
|
|
</ClippedBox>
|
|
</EventDataSection>
|
|
);
|
|
}
|