File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { useEffect , useState } from "react" ;
2-
2+ import EmptyState from "./EmptyState" ;
33interface EventType {
44 id : string ;
55 type : string ;
@@ -56,9 +56,14 @@ export default function ActivityFeed({ username }: { username: string }) {
5656 </ h2 >
5757
5858 { loading ? (
59- < p className = "text-center" > Loading...</ p >
59+ < div className = "text-center py-6 text-gray-500" >
60+ Fetching recent activity...
61+ </ div >
6062 ) : events . length === 0 ? (
61- < p className = "text-center" > No activity found</ p >
63+ < EmptyState
64+ title = "No activity found"
65+ description = "This user has no recent public GitHub activity."
66+ />
6267 ) : (
6368 events . slice ( 0 , 10 ) . map ( ( event ) => (
6469 < div
Original file line number Diff line number Diff line change 1+ interface EmptyStateProps {
2+ title : string ;
3+ description ?: string ;
4+ }
5+
6+ export default function EmptyState ( {
7+ title,
8+ description,
9+ } : EmptyStateProps ) {
10+ return (
11+ < div className = "flex flex-col items-center justify-center py-10 text-center" >
12+ < div className = "text-5xl mb-3" > 📭</ div >
13+
14+ < h2 className = "text-lg font-semibold text-gray-700 dark:text-gray-200" >
15+ { title }
16+ </ h2 >
17+
18+ { description && (
19+ < p className = "mt-2 text-sm text-gray-500 dark:text-gray-400 max-w-md" >
20+ { description }
21+ </ p >
22+ ) }
23+ </ div >
24+ ) ;
25+ }
You can’t perform that action at this time.
0 commit comments