mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import {useEffect} from 'react';
|
|
import * as Sentry from '@sentry/react';
|
|
|
|
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
|
|
import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
|
|
import {t} from 'sentry/locale';
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
import {DDMContextProvider, useDDMContext} from 'sentry/views/ddm/context';
|
|
import {DDMLayout} from 'sentry/views/ddm/layout';
|
|
|
|
function WrappedPageFiltersContainer({children}: {children: React.ReactNode}) {
|
|
const {isDefaultQuery} = useDDMContext();
|
|
return (
|
|
<PageFiltersContainer disablePersistence={isDefaultQuery}>
|
|
{children}
|
|
</PageFiltersContainer>
|
|
);
|
|
}
|
|
|
|
function DDM() {
|
|
const organization = useOrganization();
|
|
|
|
useEffect(() => {
|
|
trackAnalytics('ddm.page-view', {
|
|
organization,
|
|
});
|
|
Sentry.metrics.increment('ddm.visit');
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, []);
|
|
|
|
return (
|
|
<SentryDocumentTitle title={t('Metrics')} orgSlug={organization.slug}>
|
|
<DDMContextProvider>
|
|
<WrappedPageFiltersContainer>
|
|
<DDMLayout />
|
|
</WrappedPageFiltersContainer>
|
|
</DDMContextProvider>
|
|
</SentryDocumentTitle>
|
|
);
|
|
}
|
|
|
|
export default DDM;
|