返回 AiToEarn
1 /**
2 * PromptGallery 组件类型定义
3 * 定义视频提示词展示相关的数据结构
4 */
5
6 /**
7 * 视频提示词数据项
8 */
9 export interface PromptGalleryItem {
10 /** 提示词标题(用于弹窗标题显示) */
11 title: string
12 /** 完整的提示词内容 */
13 prompt: string
14 /** 视频封面图路径 */
15 cover: string
16 /** 视频文件路径 */
17 video: string
18 /** 参考素材图片路径列表 */
19 materials?: string[]
20 }
21
22 /**
23 * 视频卡片尺寸类型
24 * - vertical: 竖视频 (9:16),在 PC 端占据 2 行高度
25 * - horizontal: 横视频 (16:9),在 PC 端占据 1 行高度
26 */
27 export type VideoCardSize = 'vertical' | 'horizontal'
28
29 /**
30 * VideoCard 组件属性
31 */
32 export interface VideoCardProps {
33 /** 视频数据 */
34 item: PromptGalleryItem
35 /** 点击卡片回调 */
36 onClick: () => void
37 /** 卡片尺寸类型 */
38 size?: VideoCardSize
39 }
40
41 /**
42 * VideoDetailModal 组件属性
43 */
44 export interface VideoDetailModalProps {
45 /** 是否显示弹窗 */
46 open: boolean
47 /** 关闭弹窗回调 */
48 onOpenChange: (open: boolean) => void
49 /** 视频数据 */
50 item: PromptGalleryItem | null
51 /** 应用提示词回调(包含 prompt 和 materials) */
52 onApplyPrompt?: (data: { prompt: string, materials?: string[] }) => void
53 }
54
54 lines TYPESCRIPT