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

Function getFeedItemKey

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

Source from the content-addressed store, hash-verified

112 Pick<UseBookmarkPost, 'toggleBookmark'>;
113
114export function getFeedItemKey(item: FeedItem, index: number): string {
115 switch (item.type) {
116 case 'post':
117 return item.post.id;
118 case 'highlight':
119 return getHighlightIdsKey(item.highlights) || `highlight-${index}`;
120 case 'ad':
121 return `ad-${index}`;
122 default:
123 return `placeholder-${index}`;
124 }
125}
126
127const getPostTypeForCard = (post?: Post): PostType => {
128 if (!post) {

Callers 1

FeedFunction · 0.90

Calls 1

getHighlightIdsKeyFunction · 0.90

Tested by

no test coverage detected