mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import {Fragment} from 'react';
|
|
|
|
import ContextBlock from 'sentry/components/events/contexts/contextBlock';
|
|
import type {Event} from 'sentry/types';
|
|
|
|
import {getKnownData, getUnknownData} from '../utils';
|
|
|
|
import {getBrowserKnownDataDetails} from './getBrowserKnownDataDetails';
|
|
import type {BrowserKnownData} from './types';
|
|
import {BrowserKnownDataType} from './types';
|
|
|
|
type Props = {
|
|
data: BrowserKnownData;
|
|
event: Event;
|
|
};
|
|
|
|
export const browserKnownDataValues = [
|
|
BrowserKnownDataType.NAME,
|
|
BrowserKnownDataType.VERSION,
|
|
];
|
|
|
|
export function BrowserEventContext({data, event}: Props) {
|
|
const meta = event._meta?.contexts?.browser ?? {};
|
|
return (
|
|
<Fragment>
|
|
<ContextBlock
|
|
data={getKnownData<BrowserKnownData, BrowserKnownDataType>({
|
|
data,
|
|
meta,
|
|
knownDataTypes: browserKnownDataValues,
|
|
onGetKnownDataDetails: v => getBrowserKnownDataDetails(v),
|
|
})}
|
|
/>
|
|
<ContextBlock
|
|
data={getUnknownData({
|
|
allData: data,
|
|
knownKeys: [...browserKnownDataValues],
|
|
meta,
|
|
})}
|
|
/>
|
|
</Fragment>
|
|
);
|
|
}
|