import {QueryClient, QueryClientProvider} from "@tanstack/react-query";
import {useModuleStore} from "../../lib/store/useModuleStore";
import {useEffect} from "react";
import {useSettingStore} from "@/lib/store/useSettings";
//import {useGetUserRoles} from "@/lib/store/useGetRoles";

const queryClient = new QueryClient();

export const SessionProvider = ({children}: {children: React.ReactNode}) => {
    const {fetchModules} = useModuleStore();
    const {fetchSettings} = useSettingStore();
    //const {fetchUserRoles} = useGetUserRoles();

    useEffect(() => {
        fetchModules();
        fetchSettings();
        //fetchUserRoles();
    }, []);
    return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>;
};
