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

const useBaseMarketplacesList = () => {
    const { data, refetch } = useQuery(getBaseMarketplacesOptions());

    const queryKey = getBaseMarketplacesQueryKey();

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

export default useBaseMarketplacesList;
