@@ -28,7 +28,8 @@ export function QuizCard({ quiz, userProgress }: QuizCardProps) {
2828 : 0 ;
2929
3030 return (
31- < div className = "rounded-xl border border-gray-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-5 shadow-sm hover:shadow-md transition-shadow" >
31+ < div className = "flex flex-col rounded-xl border border-gray-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 p-5 shadow-sm hover:shadow-md transition-shadow" >
32+ < div className = "flex-grow" >
3233 < div className = "flex gap-2 mb-3" >
3334 < Badge variant = "blue" > { quiz . categoryName ?? t ( 'uncategorized' ) } </ Badge >
3435 { userProgress && (
@@ -39,7 +40,7 @@ export function QuizCard({ quiz, userProgress }: QuizCardProps) {
3940 { quiz . title ?? quiz . slug }
4041 </ h2 >
4142 { quiz . description && (
42- < p className = "text-sm text-gray-600 dark:text-gray-400 mb-3" >
43+ < p className = "line-clamp-2 text-sm text-gray-600 dark:text-gray-400 mb-3" >
4344 { quiz . description }
4445 </ p >
4546 ) }
@@ -49,27 +50,28 @@ export function QuizCard({ quiz, userProgress }: QuizCardProps) {
4950 ⏱️ { Math . floor ( ( quiz . timeLimitSeconds ?? quiz . questionsCount * 30 ) / 60 ) } { t ( 'min' ) }
5051 </ span >
5152 </ div >
53+ </ div >
5254 { userProgress && (
53- < div className = "mb-4 " >
54- < div className = "flex justify-between text-xs mb-1.5" >
55- < span className = "text-gray-600 dark:text-gray-400" >
56- { t ( 'best' ) } { userProgress . bestScore } /{ userProgress . totalQuestions }
57- </ span >
58- < span className = "font-medium text-gray-900 dark:text-gray-100 " >
59- { percentage } %
60- </ span >
61- </ div >
62- < div className = "h-1.5 bg-gray-200 dark:bg-neutral-800 rounded-full overflow-hidden" >
63- < div
64- className = "h-full bg-blue-600 rounded-full transition-all"
65- style = { { width : ` ${ percentage } %` } }
66- />
67- </ div >
68- < p className = "text-xs text-gray-500 mt-1" >
69- { userProgress . attemptsCount } { userProgress . attemptsCount === 1 ? t ( 'attempt' ) : t ( 'attempts' ) }
70- </ p >
71- </ div >
72- ) }
55+ < div className = "mb-6 " >
56+ < div className = "flex justify-between text-xs mb-1.5" >
57+ < span className = "text-gray-600 dark:text-gray-400" >
58+ { t ( 'best' ) } { userProgress . bestScore } /{ userProgress . totalQuestions }
59+ </ span >
60+ < span className = "text-gray-500 " >
61+ { userProgress . attemptsCount } { userProgress . attemptsCount === 1 ? t ( 'attempt' ) : t ( 'attempts' ) }
62+ </ span >
63+ < span className = "font-medium text-gray-900 dark:text-gray-100" >
64+ { percentage } %
65+ </ span >
66+ </ div >
67+ < div className = "h-1.5 bg-gray-200 dark:bg-neutral-800 rounded-full overflow-hidden" >
68+ < div
69+ className = "h-full bg-blue-600 rounded-full transition-all"
70+ style = { { width : ` ${ percentage } %` } }
71+ />
72+ </ div >
73+ </ div >
74+ ) }
7375 < Link
7476 href = { `/quiz/${ quiz . slug } ` }
7577 className = "block w-full text-center rounded-lg bg-blue-600 text-white px-4 py-2.5 text-sm font-medium hover:bg-blue-500 transition-colors"
0 commit comments