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>
23 lines
498 B
TypeScript
23 lines
498 B
TypeScript
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>
|
|
);
|
|
}
|