frontend: add bookmark management and homepage navigation
Admin-only /bookmarks page for managing entries; homepage now renders public bookmarks as a category-grouped navigation grid (empty state links admin to the manager). Dashboard gains a recent-bookmarks card, dock and main layout get a bookmark entry for admins, and the middleware protects /bookmarks. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
22
frontend/app/bookmarks/page.tsx
Normal file
22
frontend/app/bookmarks/page.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { auth } from "@/auth";
|
||||
import { redirect } from "next/navigation";
|
||||
import { BookmarkManager } from "./bookmark-manager";
|
||||
|
||||
export default async function BookmarksPage() {
|
||||
const session = await auth();
|
||||
if (!session?.user) {
|
||||
redirect("/login");
|
||||
}
|
||||
|
||||
const role = (session.user as any)?.role;
|
||||
if (role !== "admin") {
|
||||
redirect("/unauthorized");
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="mb-6 text-2xl font-bold">书签管理</h1>
|
||||
<BookmarkManager />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user