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

Function getFeedItemKey

packages/shared/src/components/FeedItemComponent.tsx:115–126  ·  view source on GitHub ↗
(item: FeedItem, index: number)

Source from the content-addressed store, hash-verified

113 Pick<UseBookmarkPost, 'toggleBookmark'>;
114
115export function getFeedItemKey(item: FeedItem, index: number): string {
116 switch (item.type) {
117 case 'post':
118 return item.post.id;
119 case 'highlight':
120 return getHighlightIdsKey(item.highlights) || `highlight-${index}`;
121 case 'ad':
122 return `ad-${index}`;
123 default:
124 return `placeholder-${index}`;
125 }
126}
127
128// eslint-disable-next-line @typescript-eslint/no-explicit-any
129const PostTypeToTagCard: Record<PostType, React.ComponentType<any>> = {

Callers 1

FeedFunction · 0.90

Calls 1

getHighlightIdsKeyFunction · 0.90

Tested by

no test coverage detected