import{useCurrentVariant as e,useFeaturedImageGlobal as r,useProductStore as t}from"@gem-sdk/core";import{useMemo as d,useEffect as m}from"react";let a=a=>{let{gallery:i}=a,o=e(),u=r(),n=t(e=>e.setProductFeaturedImage),c=d(()=>{if(!u)return 0;let e=i.findIndex(e=>e.id===u.id);return -1!==e?e:0},[u,i]);return m(()=>{o?.media&&"IMAGE"===o.media.contentType&&n(o.media)},[o,n]),{idxActive:c}};export{a as useFeatureImagePostPurchase};
