mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
32 lines
664 B
TypeScript
32 lines
664 B
TypeScript
import {t} from 'sentry/locale';
|
|
|
|
import type {BrowserKnownData} from './types';
|
|
import {BrowserKnownDataType} from './types';
|
|
|
|
type Output = {
|
|
subject: string;
|
|
value: React.ReactNode | null;
|
|
};
|
|
|
|
type Props = {
|
|
data: BrowserKnownData;
|
|
type: BrowserKnownDataType;
|
|
};
|
|
|
|
export function getBrowserKnownDataDetails({data, type}: Props): Output | undefined {
|
|
switch (type) {
|
|
case BrowserKnownDataType.NAME:
|
|
return {
|
|
subject: t('Name'),
|
|
value: data.name,
|
|
};
|
|
case BrowserKnownDataType.VERSION:
|
|
return {
|
|
subject: t('Version'),
|
|
value: `${data.version}`,
|
|
};
|
|
default:
|
|
return undefined;
|
|
}
|
|
}
|