'use client';
import { useSetPageInfo } from '@/components/providers/dashboard-provider';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@nice/ui/components/card';
import { Badge } from '@nice/ui/components/badge';
import { Button } from '@nice/ui/components/button';
import { Progress } from '@nice/ui/components/progress';
import {
IconFileText,
IconEye,
IconHeart,
IconCloud,
IconTrendingUp,
IconTrendingDown,
IconBell,
IconCalendar,
IconClock,
IconEdit,
IconShare,
IconBookmark,
IconChartBar,
IconDatabase,
IconFolder,
IconDownload,
IconUpload,
} from '@tabler/icons-react';
// 模拟用户个人数据
const userStats = {
articles: {
total: 24,
published: 18,
draft: 6,
totalViews: 15420,
totalLikes: 892,
thisMonth: 3,
growth: '+12%',
},
storage: {
used: '1.2GB',
total: '5GB',
usedBytes: 1288490189,
totalBytes: 5368709120,
filesCount: 156,
foldersCount: 12,
},
engagement: {
avgViews: 642,
avgLikes: 37,
comments: 234,
shares: 89,
bookmarks: 156,
},
};
const recentNotifications = [
{ id: 1, type: 'like', message: '您的文章《Next.js 最佳实践》收到了新的点赞', time: '5分钟前', unread: true },
{ id: 2, type: 'comment', message: '用户李四评论了您的文章《TypeScript 进阶指南》', time: '1小时前', unread: true },
{ id: 3, type: 'follow', message: '用户王五关注了您', time: '2小时前', unread: false },
{ id: 4, type: 'system', message: '您的存储空间使用已达到60%', time: '6小时前', unread: false },
];
const recentArticles = [
{ id: 1, title: 'Next.js 最佳实践指南', status: 'published', views: 1240, likes: 89, publishedAt: '2024-01-15' },
{ id: 2, title: 'TypeScript 进阶技巧', status: 'published', views: 856, likes: 67, publishedAt: '2024-01-12' },
{ id: 3, title: 'React Hooks 深度解析', status: 'draft', views: 0, likes: 0, publishedAt: null },
{ id: 4, title: 'Tailwind CSS 实战教程', status: 'published', views: 1523, likes: 124, publishedAt: '2024-01-08' },
];
const quickActions = [
{ title: '写新文章', icon: IconEdit, href: '/editor', description: '开始创作新的文章' },
{ title: '上传文件', icon: IconUpload, href: '/resource', description: '上传文件到云盘' },
// { title: '查看统计', icon: IconChartBar, href: '/articles/analytics', description: '查看文章数据分析' },
// { title: '管理文件', icon: IconFolder, href: '/drive', description: '管理您的云盘文件' },
];
function StatsCard({
title,
value,
description,
icon: Icon,
trend,
trendValue,
className = '',
}: {
title: string;
value: string | number;
description: string;
icon: any;
trend?: 'up' | 'down';
trendValue?: string;
className?: string;
}) {
return (
{notification.message} {article.title}