import { FollowShopParams, UnfollowShopParams, } from '@shopify/shop-minis-platform/actions' import {useHandleAction} from '../../internal/useHandleAction' import {useShopActions} from '../../internal/useShopActions' export interface UseFollowedShopsActionsReturns { /** * Follows a shop. */ followShop: (params: FollowShopParams) => Promise /** * Unfollows a shop. */ unfollowShop: (params: UnfollowShopParams) => Promise } export const useFollowedShopsActions = (): UseFollowedShopsActionsReturns => { const {followShop, unfollowShop} = useShopActions() return { followShop: useHandleAction(followShop), unfollowShop: useHandleAction(unfollowShop), } } /** * The `useFollowedShopsActions` hook provides mutation functions to follow and unfollow shops. Returns `followShop()` and `unfollowShop()` functions that accept a shop GID. Following a shop adds it to the user's followed shops collection in the Shop app, enabling personalized recommendations. `useFollowedShops()` hook can be used to display current follow status. * * * > Caution: This hook requires adding the following scopes to the manifest file: * > * > `shops:follows:write` * > * > For more details, see [manifest.json](/docs/api/shop-minis/manifest-file). * * @publicDocs */ export type UseFollowedShopsActionsGeneratedType = () => UseFollowedShopsActionsReturns