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>
  );
}
