postio / apps /frontend /src /components /layout /sentry.component.tsx
Leon4gr45's picture
Upload folder using huggingface_hub (part 7)
ec4551b verified
Raw
History Blame Contribute Delete
562 Bytes
'use client';
import { FC, ReactNode, useEffect } from 'react';
import { useVariables } from '@gitroom/react/helpers/variable.context';
import { initializeSentryClient } from '@gitroom/react/sentry/initialize.sentry.client';
export const SentryComponent: FC<{ children: ReactNode }> = ({ children }) => {
const { sentryDsn: dsn, environment } = useVariables();
useEffect(() => {
if (!dsn) {
return;
}
initializeSentryClient(environment, dsn);
}, [dsn]);
// Always render children - don't block the app
return <>{children}</>;
};