@@ -6,30 +6,24 @@ interface ContributorCardProps {
66 name : string ;
77 avatar : string ;
88 role : string ;
9-
109 contributions : number ; // Changed to number for consistency
1110 lastActive ?: string ; // Made optional for flexibility
12-
1311}
1412
1513const ContributorCard : React . FC < ContributorCardProps > = ( { name, avatar, role, contributions, lastActive } ) => {
1614 const [ isExpanded , setIsExpanded ] = useState ( false ) ;
1715
1816 return (
19-
2017 < motion . div
21-
2218 whileHover = { { scale : 1.02 } }
2319 className = "bg-gray-900 p-6 rounded-xl border border-gray-800 hover:border-green-500 transition-all duration-300 cursor-pointer"
2420 onClick = { ( ) => setIsExpanded ( ! isExpanded ) }
2521 >
2622 < div className = "flex items-center space-x-4" >
27-
2823 < motion . img
2924 whileHover = { { scale : 1.1 } }
3025 src = { avatar }
3126 alt = { name }
32-
3327 className = "w-12 h-12 rounded-full"
3428 />
3529 < div >
@@ -39,43 +33,39 @@ const ContributorCard: React.FC<ContributorCardProps> = ({ name, avatar, role, c
3933 </ div >
4034
4135 < motion . div
42-
4336 initial = { false }
44- animate = { { height : isExpanded ? 'auto' : 'auto' } }
37+ animate = { { height : isExpanded ? 'auto' : 0 } }
4538 className = "mt-4 space-y-2"
4639 >
4740 < div className = "flex justify-between text-sm" >
4841 < span className = "text-gray-400" > Contributions</ span >
49-
5042 < motion . span
51-
5243 initial = { { opacity : 0 } }
5344 animate = { { opacity : 1 } }
5445 className = "text-green-400"
5546 >
5647 { contributions }
5748 </ motion . span >
58-
49+ </ div >
50+
5951 { lastActive && (
6052 < div className = "flex justify-between text-sm" >
6153 < span className = "text-gray-400" > Last Active</ span >
6254 < span className = "text-gray-300" > { lastActive } </ span >
6355 </ div >
6456 ) }
57+
6558 { isExpanded && (
6659 < motion . div
67-
6860 initial = { { opacity : 0 , height : 0 } }
6961 animate = { { opacity : 1 , height : 'auto' } }
7062 exit = { { opacity : 0 , height : 0 } }
7163 className = "pt-4 border-t border-gray-800 mt-4"
7264 >
73-
7465 < button
7566 onClick = { ( e ) => {
7667 e . stopPropagation ( ) ;
7768 toast . success ( `Message sent to ${ name } ` ) ;
78-
7969 } }
8070 className = "w-full bg-green-500 hover:bg-green-600 text-white py-2 rounded-lg transition-colors"
8171 >
0 commit comments