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

const useProjectsList = () => {
    const { data, refetch, isLoading } = useQuery({
        ...getProjectsOptions(),
    });
    const projects = !data ? [] : data.projects;
    return { projects, refetch, isLoading };
};

export default useProjectsList;
