import {useShopActionInfiniteQuery} from '../../internal/reactQuery' import {useShopActions} from '../../internal/useShopActions' import { PaginatedDataHookOptionsBase, PaginatedDataHookReturnsBase, Shop, } from '../../types' export interface UseFollowedShopsParams extends PaginatedDataHookOptionsBase {} export interface UseFollowedShopsReturns extends PaginatedDataHookReturnsBase { /** * The followed shops returned from the query. */ shops: Shop[] | null } export const useFollowedShops = ( params?: UseFollowedShopsParams ): UseFollowedShopsReturns => { const {getFollowedShops} = useShopActions() const {skip = false, ...restParams} = params ?? {} const {data, ...rest} = useShopActionInfiniteQuery( ['followedShops', restParams], getFollowedShops, restParams, {skip} ) return { ...rest, shops: data, } } /** * The `useFollowedShops` hook fetches the collection of shops the user follows in the Shop app. Use this to display followed brands, create quick-access shop lists, show follow status in UI, or build social commerce features. Pair with `useFollowedShopsActions()` to manage follow/unfollow operations. * @publicDocs */ export type UseFollowedShopsGeneratedType = ( params?: UseFollowedShopsParams ) => UseFollowedShopsReturns