- 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/pages/writer/WriterDashboard.tsx
r99c1e45 ra8f4a2d 1 1 import React, { useEffect } from 'react' 2 2 import { useNavigate } from 'react-router-dom' 3 import { Plus, BookOpen, Heart, MessageCircle, TrendingUp, Bell } from 'lucide-react'3 import { Plus, BookOpen, Heart, MessageCircle, TrendingUp, Bell, Eye } from 'lucide-react' 4 4 import { useAuthStore } from '../../store/authStore' 5 5 import { useStoryStore } from '../../store/storyStore' … … 37 37 const drafts = myStories.filter(s => s.status === 'draft') 38 38 const totalLikes = myStories.reduce((acc, s) => acc + s.total_likes, 0) 39 const totalViews = myStories.reduce((acc, s) => acc + s.total_views, 0) 39 40 40 41 const recentNotifs = notifications.slice(0, 5) … … 57 58 58 59 {/* Stats */} 59 <div className="grid grid-cols-2 lg:grid-cols- 3gap-4 mb-8">60 <div className="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8"> 60 61 {[ 61 62 { icon: <BookOpen size={20} className="text-indigo-300" />, label: 'Total Stories', value: myStories.length, sub: `${published.length} published`, color: 'bg-indigo-500/20' }, 62 63 { icon: <Heart size={20} className="text-rose-300" />, label: 'Total Likes', value: totalLikes.toLocaleString(), sub: 'Across all stories', color: 'bg-rose-500/20' }, 64 { icon: <Eye size={20} className="text-cyan-300" />, label: 'Total Views', value: totalViews.toLocaleString(), sub: 'Chapter reads', color: 'bg-cyan-500/20' }, 63 65 { icon: <TrendingUp size={20} className="text-emerald-300" />, label: 'Drafts', value: drafts.length, sub: 'In progress', color: 'bg-emerald-500/20' }, 64 66 ].map(s => ( … … 110 112 <span className="flex items-center gap-1"><Heart size={11} /> {story.total_likes}</span> 111 113 <span className="flex items-center gap-1"><MessageCircle size={11} /> {story.total_comments}</span> 114 <span className="flex items-center gap-1"><Eye size={11} /> {story.total_views.toLocaleString()}</span> 112 115 <span>{story.total_chapters} chapters</span> 113 116 </div>
Note:
See TracChangeset
for help on using the changeset viewer.
