33import { useLocale , useTranslations } from 'next-intl' ;
44import { cn } from '@/lib/utils' ;
55import { Button } from '@/components/ui/button' ;
6+ import { Clock , BookOpen , TrendingUp , Trophy , AlertTriangle } from 'lucide-react' ;
67
78interface QuizResultProps {
89 score : number ;
@@ -35,49 +36,48 @@ export function QuizResult({
3536 const t = useTranslations ( 'quiz.result' ) ;
3637 const getMotivationalMessage = ( ) => {
3738 if ( isIncomplete && answeredCount > 0 ) {
38- return {
39- emoji : '⏱️' ,
40- title : 'Час вийшов' ,
41- message : `Ви відповіли на ${ answeredCount } з ${ total } питань. Результат не зараховано.` ,
42- color : 'text-orange-600 dark:text-orange-400' ,
43- } ;
44- }
45-
39+ return {
40+ icon : < Clock className = "w-14 h-14 text-orange-500" /> ,
41+ title : t ( 'incomplete.title' ) ,
42+ message : t ( 'incomplete.message' , { answeredCount, total } ) ,
43+ color : 'text-orange-600 dark:text-orange-400' ,
44+ } ;
45+ }
4646 if ( score === 0 && answeredCount === 0 ) {
47- return {
48- emoji : '⏱️' ,
49- title : t ( 'timeUp.title' ) ,
50- message : t ( 'timeUp.message' ) ,
51- color : 'text-gray-600 dark:text-gray-400' ,
52- } ;
53- }
47+ return {
48+ icon : < Clock className = "w-14 h-14 text-gray-500" /> ,
49+ title : t ( 'timeUp.title' ) ,
50+ message : t ( 'timeUp.message' ) ,
51+ color : 'text-gray-600 dark:text-gray-400' ,
52+ } ;
53+ }
5454
55- if ( score === 0 && answeredCount > 0 ) {
56- return {
57- emoji : '📚' ,
58- title : t ( 'allWrong.title' ) ,
59- message : t ( 'allWrong.message' ) ,
60- color : 'text-red-600 dark:text-red-400' ,
61- } ;
62- }
55+ if ( score === 0 && answeredCount > 0 ) {
56+ return {
57+ icon : < BookOpen className = "w-14 h-14 text-red-500" /> ,
58+ title : t ( 'allWrong.title' ) ,
59+ message : t ( 'allWrong.message' ) ,
60+ color : 'text-red-600 dark:text-red-400' ,
61+ } ;
62+ }
6363
6464 if ( percentage < 50 ) {
6565 return {
66- emoji : '📚' ,
66+ icon : < BookOpen className = "w-14 h-14 text-red-500" /> ,
6767 title : t ( 'needPractice.title' ) ,
6868 message : t ( 'needPractice.message' ) ,
6969 color : 'text-red-600 dark:text-red-400' ,
7070 } ;
7171 } else if ( percentage < 80 ) {
7272 return {
73- emoji : '💪' ,
73+ icon : < TrendingUp className = "w-14 h-14 text-orange-500" /> ,
7474 title : t ( 'goodJob.title' ) ,
7575 message : t ( 'goodJob.message' ) ,
7676 color : 'text-orange-600 dark:text-orange-400' ,
7777 } ;
7878 } else {
7979 return {
80- emoji : '🎉' ,
80+ icon : < Trophy className = "w-14 h-14 text-amber-500" /> ,
8181 title : t ( 'excellent.title' ) ,
8282 message : t ( 'excellent.message' ) ,
8383 color : 'text-green-600 dark:text-green-400' ,
@@ -89,7 +89,7 @@ export function QuizResult({
8989
9090 return (
9191 < div className = "max-w-2xl mx-auto space-y-8" >
92- < div className = "text-center text-6xl " > { motivation . emoji } </ div >
92+ < div className = "flex justify-center " > { motivation . icon } </ div >
9393 { ! isIncomplete && (
9494 < >
9595 < div className = "text-center space-y-2" >
@@ -124,7 +124,7 @@ export function QuizResult({
124124{ violationsCount >= 3 && (
125125 < div className = "p-4 rounded-xl bg-orange-50 dark:bg-orange-900/20 border border-orange-200 dark:border-orange-800" >
126126 < p className = "text-center text-orange-800 dark:text-orange-200 font-medium" >
127- < span aria-hidden = "true" > ⚠️ </ span > { t ( 'violations' , { count : violationsCount } ) }
127+ < AlertTriangle className = "w-4 h-4 inline" / > { t ( 'violations' , { count : violationsCount } ) }
128128 </ p >
129129 </ div >
130130 ) }
0 commit comments