- Timestamp:
- 06/24/26 16:51:52 (11 days ago)
- Branches:
- main
- Children:
- 3ae4bab
- Parents:
- 99c1e45
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapterx-frontend/src/components/admin/PlatformStats.tsx
r99c1e45 ra8f4a2d 1 1 import React, { useEffect } from 'react' 2 import { Users, BookOpen, Heart, MessageCircle } from 'lucide-react'2 import { Users, BookOpen, Heart, MessageCircle, Eye } from 'lucide-react' 3 3 import { useAuthStore } from '../../store/authStore' 4 4 import { useStoryStore } from '../../store/storyStore' … … 12 12 const totalLikes = stories.reduce((acc, s) => acc + s.total_likes, 0) 13 13 const totalComments = stories.reduce((acc, s) => acc + s.total_comments, 0) 14 const totalViews = stories.reduce((acc, s) => acc + s.total_views, 0) 14 15 const published = stories.filter(s => s.status === 'published').length 15 16 … … 17 18 { icon: <Users size={24} className="text-blue-300" />, label: 'Total Users', value: allUsers.length, color: 'bg-blue-500/20', change: `${allUsers.filter(u => u.role === 'writer').length} writers` }, 18 19 { icon: <BookOpen size={24} className="text-violet-300" />, label: 'Total Stories', value: stories.length, color: 'bg-violet-500/20', change: `${published} published` }, 20 { icon: <Eye size={24} className="text-cyan-300" />, label: 'Total Views', value: totalViews.toLocaleString(), color: 'bg-cyan-500/20', change: 'Chapter reads' }, 19 21 { icon: <Heart size={24} className="text-rose-300" />, label: 'Total Likes', value: totalLikes.toLocaleString(), color: 'bg-rose-500/20', change: 'Across all stories' }, 20 22 { icon: <MessageCircle size={24} className="text-emerald-300" />, label: 'Total Comments', value: totalComments.toLocaleString(), color: 'bg-emerald-500/20', change: 'Platform-wide' }, … … 22 24 23 25 return ( 24 <div className="grid grid-cols-2 md:grid-cols- 4gap-4">26 <div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4"> 25 27 {stats.map(stat => ( 26 28 <div key={stat.label} className="bg-slate-800 border border-slate-700 rounded-2xl p-6">
Note:
See TracChangeset
for help on using the changeset viewer.
