prompt-filters.tsx

prompt-filters.tsx

基本信息

  • 类型: React Client 组件
  • 路径: ./src/components/prompts/prompt-filters.tsx

功能描述

Prompt筛选组件,用于Prompt列表页面的筛选功能。支持搜索、类型筛选、分类筛选、标签筛选、排序和AI搜索切换。响应式设计,移动端使用折叠面板,桌面端使用常驻显示。

导出内容

  • PromptFilters - 主组件
  • PromptFiltersProps - Props接口

Props 接口

属性类型说明
categoriesarray分类列表
tagsarray标签列表
currentFiltersobject当前筛选条件
currentFilters.qstring搜索关键词
currentFilters.typestring类型筛选
currentFilters.categorystring分类筛选
currentFilters.tagstring标签筛选
currentFilters.sortstring排序方式
currentFilters.aistringAI搜索开关
aiSearchEnabledbooleanAI搜索是否启用

支持类型

  • TEXT - 文本
  • STRUCTURED - 结构化
  • IMAGE - 图片
  • VIDEO - 视频
  • AUDIO - 音频

排序选项

  • newest - 最新
  • oldest - 最早
  • upvotes - 最多投票

依赖

  • next/navigation - Next.js导航
  • next-intl - 国际化
  • next/image - Next.js图片
  • lucide-react - 图标库
  • @/components/ui/label - 标签组件
  • @/components/ui/input - 输入框组件
  • @/components/ui/select - 选择器组件
  • @/components/ui/button - 按钮组件
  • @/components/ui/switch - 开关组件
  • ./filter-context - 筛选上下文
  • @/lib/analytics - 分析工具
  • @/../prompts.config - 应用配置

相关组件

  • PromptList - Prompt列表
  • FilterProvider - 筛选上下文提供者
← 返回目录