1+ import React from 'react' ;
2+
3+ // This data array makes the component "Reusable" as per requirements
4+ const timelineEvents = [
5+ { id : 1 , label : 'Escrow Created' , status : 'completed' , date : 'Oct 24, 2025' } ,
6+ { id : 2 , label : 'Milestone Funded' , status : 'completed' , date : 'Oct 25, 2025' } ,
7+ { id : 3 , label : 'Payment Released' , status : 'current' , date : 'In Progress' } ,
8+ { id : 4 , label : 'Dispute Raised' , status : 'upcoming' , date : 'Pending' } ,
9+ ] ;
10+
11+ const ActivityTimeline = ( ) => {
12+ return (
13+ < div className = "p-6 bg-white rounded-lg shadow-md max-w-lg mx-auto" >
14+ < h2 className = "text-xl font-bold mb-6 text-gray-800" > Contract Activity Timeline</ h2 >
15+
16+ < div className = "relative" >
17+ { /* The Vertical Line */ }
18+ < div className = "absolute left-4 top-0 h-full w-0.5 bg-gray-200" > </ div >
19+
20+ < div className = "space-y-8" >
21+ { timelineEvents . map ( ( event ) => (
22+ < div key = { event . id } className = "relative flex items-center ml-1" >
23+
24+ { /* Step Indicator Dot */ }
25+ < div className = { `z-10 w-7 h-7 rounded-full flex items-center justify-center border-2
26+ ${ event . status === 'completed' ? 'bg-green-500 border-green-500' :
27+ event . status === 'current' ? 'bg-white border-blue-500 animate-pulse' :
28+ 'bg-white border-gray-300' } `} >
29+
30+ { event . status === 'completed' && (
31+ < span className = "text-white text-xs" > ✓</ span >
32+ ) }
33+ { event . status === 'current' && (
34+ < div className = "w-2 h-2 bg-blue-500 rounded-full" > </ div >
35+ ) }
36+ </ div >
37+
38+ { /* Event Content */ }
39+ < div className = "ml-6" >
40+ < p className = { `font-semibold ${ event . status === 'upcoming' ? 'text-gray-400' : 'text-gray-900' } ` } >
41+ { event . label }
42+ </ p >
43+ < p className = "text-xs text-gray-500 uppercase tracking-wide" >
44+ { event . date }
45+ </ p >
46+ </ div >
47+
48+ </ div >
49+ ) ) }
50+ </ div >
51+ </ div >
52+ </ div >
53+ ) ;
54+ } ;
55+
56+ export default ActivityTimeline ;
0 commit comments