(item: FeedItem, index: number)
| 114 | Pick<UseBookmarkPost, 'toggleBookmark'>; |
| 115 | |
| 116 | export 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 |
| 130 | const PostTypeToTagCard: Record<PostType, React.ComponentType<any>> = { |
no test coverage detected