import useUserStore from '@/stores/UserStore';
import { useEffect } from 'react';

const AuthUser = () => {
    const { user, fetchUser } = useUserStore();

    useEffect(() => {
        // Always try to fetch user data on component mount
        if (user === null) {
            fetchUser();
        }
    }, [user, fetchUser]);
};

export default AuthUser;
