mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 16:22:59 +10:00
18 lines
489 B
TypeScript
18 lines
489 B
TypeScript
import * as Sentry from '@sentry/nextjs';
|
|
import { useEffect } from 'react';
|
|
|
|
import { useAppSelector } from '@/store/hooks';
|
|
|
|
const SentryWrapper: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => {
|
|
const user = useAppSelector((state) => state.auth.user);
|
|
|
|
useEffect(() => {
|
|
const sentryUser: Sentry.User | null = user && { ...user, id: user?.id.toString() };
|
|
Sentry.setUser(sentryUser);
|
|
}, [user]);
|
|
|
|
return <>{children}</>;
|
|
};
|
|
|
|
export default SentryWrapper;
|