aboutsummaryrefslogtreecommitdiffstats
path: root/frontend-vanilla/src/components/FeedItem.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend-vanilla/src/components/FeedItem.ts')
-rw-r--r--frontend-vanilla/src/components/FeedItem.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/frontend-vanilla/src/components/FeedItem.ts b/frontend-vanilla/src/components/FeedItem.ts
new file mode 100644
index 0000000..3bf72c2
--- /dev/null
+++ b/frontend-vanilla/src/components/FeedItem.ts
@@ -0,0 +1,11 @@
+import type { Feed } from '../types';
+
+export function createFeedItem(feed: Feed, isActive: boolean): string {
+ return `
+ <li class="feed-item ${isActive ? 'active' : ''}" data-id="${feed._id}">
+ <a href="/v3/feed/${feed._id}" class="feed-link" onclick="event.preventDefault(); window.app.navigate('/feed/${feed._id}')">
+ ${feed.title || feed.url}
+ </a>
+ </li>
+ `;
+}