()
| 17 | } |
| 18 | |
| 19 | export const useFetchAd = (): UseFetchAds => { |
| 20 | const boostsEnabled = useFeature(featurePostBoostAds); |
| 21 | const consent = useAdMacroContext(true) ?? undefined; |
| 22 | |
| 23 | const fetchAdQuery: UseFetchAds['fetchAd'] = useCallback( |
| 24 | ({ active, placement = AdPlacement.Feed }) => { |
| 25 | return fetchAdByPlacement( |
| 26 | resolveAdFetchOptions({ |
| 27 | placement, |
| 28 | active, |
| 29 | boostsEnabled, |
| 30 | consent, |
| 31 | }), |
| 32 | ); |
| 33 | }, |
| 34 | [boostsEnabled, consent], |
| 35 | ); |
| 36 | |
| 37 | return { |
| 38 | fetchAd: fetchAdQuery, |
| 39 | }; |
| 40 | }; |
no test coverage detected