aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/app/dashboard/feeds
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2024-11-03 17:30:17 +0000
committerMohamed Bassem <me@mbassem.com>2024-11-03 17:30:17 +0000
commitfa8286aa900ea4f13c1c15d5b0f441436f042d8a (patch)
tree380a2464f3777059aad67f37bcbdc9ada030327f /apps/web/app/dashboard/feeds
parentcf1a25131fd45ab7c9a72b837be525c24457cd8b (diff)
downloadkarakeep-fa8286aa900ea4f13c1c15d5b0f441436f042d8a.tar.zst
feature(web): Add the ability to view the bookmarks of a particular rss feed
Diffstat (limited to 'apps/web/app/dashboard/feeds')
-rw-r--r--apps/web/app/dashboard/feeds/[feedId]/page.tsx31
1 files changed, 31 insertions, 0 deletions
diff --git a/apps/web/app/dashboard/feeds/[feedId]/page.tsx b/apps/web/app/dashboard/feeds/[feedId]/page.tsx
new file mode 100644
index 00000000..ed5f9e40
--- /dev/null
+++ b/apps/web/app/dashboard/feeds/[feedId]/page.tsx
@@ -0,0 +1,31 @@
+import { notFound } from "next/navigation";
+import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks";
+import { api } from "@/server/api/client";
+import { TRPCError } from "@trpc/server";
+
+export default async function FeedPage({
+ params,
+}: {
+ params: { feedId: string };
+}) {
+ let feed;
+ try {
+ feed = await api.feeds.get({ feedId: params.feedId });
+ } catch (e) {
+ if (e instanceof TRPCError) {
+ if (e.code == "NOT_FOUND") {
+ notFound();
+ }
+ }
+ throw e;
+ }
+
+ return (
+ <Bookmarks
+ query={{ rssFeedId: feed.id }}
+ showDivider={true}
+ showEditorCard={false}
+ header={<div className="text-2xl">{feed.name}</div>}
+ />
+ );
+}