collection/page.tsx

collection/page.tsx

基本信息

  • 类型: Next.js 页面 (Server Component)
  • 路径: ./src/app/collection/page.tsx

功能描述

用户收藏页面,展示用户收藏的 Prompt 列表。需要登录才能访问。

路由

  • 路径: /collection
  • 参数: 无

依赖导入

  • next/link - Next.js 链接组件
  • next/navigation - Next.js 重定向函数
  • next-intl/server - 服务端国际化翻译
  • lucide-react - 图标库(ArrowRight、Bookmark、Sparkles)
  • @/lib/auth - 认证模块
  • @/lib/db - Prisma 数据库客户端
  • @/components/ui/button - UI 按钮组件
  • @/components/prompts/prompt-list - Prompt 列表组件

主要功能

  • 验证用户登录状态,未登录重定向到登录页
  • 从数据库获取用户的收藏列表
  • 过滤已删除的 Prompt
  • 展示收藏的 Prompt 列表
  • 空状态提示引导用户浏览 Prompts
  • 提供浏览全部和发现更多按钮
  • 显示收藏数量和排序(按收藏时间倒序)

SEO

  • title: My Collection - Saved Prompts
  • description: 查看和管理你收藏的 AI Prompts
← 返回目录