MCPcopy Create free account
hub / github.com/dailydotdev/apps / getAdEntity

Function getAdEntity

packages/shared/src/features/monetization/useAdEntityRef.ts:11–27  ·  view source on GitHub ↗
({
  postId,
  squadId,
}: {
  postId?: string;
  squadId?: string;
})

Source from the content-addressed store, hash-verified

9import { useOptionalSquadPageContext } from '../squads/SquadPageContext';
10
11const getAdEntity = ({
12 postId,
13 squadId,
14}: {
15 postId?: string;
16 squadId?: string;
17}): AdEntityTarget | undefined => {
18 if (postId) {
19 return { entity: AdEntity.Post, id: postId };
20 }
21
22 if (squadId) {
23 return { entity: AdEntity.Source, id: squadId };
24 }
25
26 return undefined;
27};
28
29interface UseAdEntityRef {
30 entityRef: MutableRefObject<AdEntityTarget | undefined>;

Callers 1

useAdEntityRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected