@@ -38,19 +38,32 @@ const TestimonialCard: React.FC<TestimonialCardProps> = ({
3838 initial = { { opacity : 0 } }
3939 animate = { { opacity : 1 } }
4040 exit = { { opacity : 0 } }
41- className = { `rounded-2xl p-4 shadow-md hover:shadow-lg transition-shadow duration-300 flex flex-col justify-between ${
41+ className = { `rounded-2xl p-6 shadow-md hover:shadow-lg transition-all duration-300 flex flex-col justify-between h-full ${
4242 isDark ? "bg-[#1a1a1a] text-white" : "bg-white text-gray-900"
4343 } `}
4444 >
45- { /* Header with Avatar and Name */ }
46- < div className = "flex items-center gap-3 " >
47- < Avatar className = "w-16 h-16 rounded-full" >
48- < AvatarImage src = { avatar } className = "object-cover" />
49- < AvatarFallback > CN</ AvatarFallback >
50- </ Avatar >
51- < div className = "box-border p-0 m-0" >
45+ { /* Header */ }
46+ < div className = "flex items-center gap-4 mb-4" >
47+ < div className = "relative w-16 h-16 flex-shrink-0" >
48+ < div className = "w-full h-full rounded-full overflow-hidden border border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 flex items-center justify-center" >
49+ { avatar ? (
50+ < img
51+ src = { avatar }
52+ alt = { name }
53+ className = "w-full h-[180px] overflow-hidden object-cover rounded-full"
54+ loading = "lazy"
55+ />
56+ ) : (
57+ < span className = "text-sm font-semibold" >
58+ { name ?. charAt ( 0 ) ?. toUpperCase ( ) ?? "U" }
59+ </ span >
60+ ) }
61+ </ div >
62+ </ div >
63+
64+ < div className = "flex flex-col" >
5265 < h3
53- className = { `font-semibold text-base ${
66+ className = { `font-semibold text-lg leading-tight ${
5467 isDark ? "text-white" : "text-gray-900"
5568 } `}
5669 >
@@ -66,34 +79,42 @@ const TestimonialCard: React.FC<TestimonialCardProps> = ({
6679
6780 { /* Content */ }
6881 < p
69- className = { `line-clamp-4 ${ isDark ? "text-gray-300" : "text-gray-700" } ` }
82+ className = { `text-sm line-clamp-4 ${
83+ isDark ? "text-gray-300" : "text-gray-700"
84+ } `}
7085 >
71- { content . length > 100 ? content . slice ( 0 , 99 ) + "..." : content }
86+ { content . length > 111 ? content . slice ( 0 , 111 ) + "..." : content }
7287 </ p >
7388
74- { /* Footer with Hashtags and Date */ }
89+ { /* Footer */ }
7590 < div
76- className = { `flex flex-col gap-2 text-sm border-t ${
91+ className = { `pt-1 border-t text-sm flex flex-col gap-2 ${
7792 isDark ? "border-gray-700" : "border-gray-200"
7893 } `}
7994 >
8095 { /* Hashtags */ }
81- < div className = "flex gap-2 flex-wrap" >
82- { content
83- . match ( / # \w + / g)
84- ?. slice ( 0 , 3 )
85- . map ( ( hashtag , index ) => (
86- < span
87- key = { index }
88- className = "text-blue-500 hover:text-blue-600 cursor-pointer"
89- >
90- { hashtag }
91- </ span >
92- ) ) }
93- </ div >
96+ { content . match ( / # \w + / g) && (
97+ < div className = "flex flex-wrap gap-2" >
98+ { content
99+ . match ( / # \w + / g)
100+ ?. slice ( 0 , 3 )
101+ . map ( ( tag , i ) => (
102+ < span
103+ key = { i }
104+ className = { `px-2 py-0.5 rounded-md text-xs font-medium ${
105+ isDark
106+ ? "bg-blue-900/40 text-blue-300"
107+ : "bg-blue-50 text-blue-700"
108+ } `}
109+ >
110+ { tag }
111+ </ span >
112+ ) ) }
113+ </ div >
114+ ) }
94115
95- { /* Link and Date Row */ }
96- < div className = "flex items-center justify-between mt-1 " >
116+ { /* Link and Date */ }
117+ < div className = "flex items-center justify-between" >
97118 < a
98119 href = { link }
99120 target = "_blank"
0 commit comments