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

Function getFeedItemKey

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

Source from the content-addressed store, hash-verified

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

Callers 1

FeedFunction · 0.90

Calls 1

getHighlightIdsKeyFunction · 0.90

Tested by

no test coverage detected