Files
bw-expo-app/components/HistoryCard.example.tsx
imeepos b9399bf4cf feat: 应用界面重构 - 从模板中心到AI内容生成平台
- 重构首页:从模板列表展示改为AI功能展示界面
- 更新底部导航:将explore改为content,index改为home
- 新增多个页面:积分、兑换、历史记录、结果展示、设置等
- 优化UI组件:新增通用按钮、分类标签、加载状态等组件
- 清理冗余文件:删除旧的认证文档和积分详情页面
- 更新主题配置:调整配色方案和视觉风格
- 修复导入路径:优化组件导入结构

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-31 17:53:56 +08:00

50 lines
1.4 KiB
TypeScript

import React from 'react';
import { ScrollView } from 'react-native';
import { HistoryCard } from './HistoryCard';
export function HistoryCardExample() {
const mockData = [
{
templateName: 'AI视频生成模板',
createdAt: new Date(Date.now() - 30 * 60 * 1000).toISOString(),
preview: '生成了一个关于科技产品的宣传视频...',
status: 'completed' as const,
},
{
templateName: '图片处理模板',
createdAt: new Date(Date.now() - 2 * 60 * 60 * 1000).toISOString(),
status: 'running' as const,
},
{
templateName: '文本摘要模板',
createdAt: new Date(Date.now() - 5 * 60 * 60 * 1000).toISOString(),
preview: '对长篇文章进行了智能摘要,提取了核心观点和关键信息...',
status: 'failed' as const,
},
];
const handleView = (index: number) => {
console.log('查看详情:', index);
};
const handleDelete = (index: number) => {
console.log('删除:', index);
};
return (
<ScrollView style={{ flex: 1 }}>
{mockData.map((item, index) => (
<HistoryCard
key={index}
templateName={item.templateName}
createdAt={item.createdAt}
preview={item.preview}
status={item.status}
onView={() => handleView(index)}
onDelete={() => handleDelete(index)}
/>
))}
</ScrollView>
);
}