diff options
Diffstat (limited to 'apps/web/app/dashboard/lists')
| -rw-r--r-- | apps/web/app/dashboard/lists/[listId]/page.tsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/web/app/dashboard/lists/[listId]/page.tsx b/apps/web/app/dashboard/lists/[listId]/page.tsx index 4714a71c..3f9c3416 100644 --- a/apps/web/app/dashboard/lists/[listId]/page.tsx +++ b/apps/web/app/dashboard/lists/[listId]/page.tsx @@ -1,3 +1,4 @@ +import type { Metadata } from "next"; import { notFound } from "next/navigation"; import Bookmarks from "@/components/dashboard/bookmarks/Bookmarks"; import ListHeader from "@/components/dashboard/lists/ListHeader"; @@ -6,6 +7,23 @@ import { TRPCError } from "@trpc/server"; import { BookmarkListContextProvider } from "@karakeep/shared-react/hooks/bookmark-list-context"; +export async function generateMetadata(props: { + params: Promise<{ listId: string }>; +}): Promise<Metadata> { + const params = await props.params; + try { + const list = await api.lists.get({ listId: params.listId }); + return { + title: `${list.name} | Karakeep`, + }; + } catch (e) { + if (e instanceof TRPCError && e.code === "NOT_FOUND") { + notFound(); + } + throw e; + } +} + export default async function ListPage(props: { params: Promise<{ listId: string }>; searchParams?: Promise<{ |
