import { useQuery } from "@tanstack/react-query";
import { getModulesOptions } from "@/lib/client/@tanstack/react-query.gen";

const useModulesList = () => {
    const { data, refetch } = useQuery(getModulesOptions());

    return {
        modules: data?.items ?? [],
        refetch,
    };
};

export default useModulesList;
