{/* Header / Navbar */}
{/* Tabs */}
{/* Main Content Area */}
{/* ================= TAB 1: DICTIONARY ================= */}
{activeTab === 'dictionary' && (
);
}
القاموس اللغوي الذكي
للصف الرابع الابتدائي
{/* Search Bar */}
setSearchTerm(e.target.value)}
/>
{/* Dictionary Grid */}
)}
{/* ================= TAB 2: QUIZ ================= */}
{activeTab === 'quiz' && (
{filteredDictionary.length > 0 ? (
filteredDictionary.map((item) => (
))
) : (
)}
{item.word}
{item.typeInfo}
المعنى:
{item.meaning}
المضاد:
{item.opposite}
مثال: {item.example}
لم نجد هذه الكلمة!
حاول البحث بكلمة أخرى أو راجع كتاب اللغة العربية.
{!showResults ? (
)}
)}
{/* Quiz Header */}
تطبيقات القاموس
{/* Progress Bar */}
{/* Question Area */}
) : (
/* Quiz Results */
السؤال {currentQuestionIndex + 1} من {quizData.length}
{quizData[currentQuestionIndex].question}
{quizData[currentQuestionIndex].options.map((option, idx) => {
// تحديد حالة الزر (عادي، صحيح، خطأ)
let buttonClass = "w-full text-right p-5 rounded-2xl text-xl font-medium border-2 transition-all duration-300 flex justify-between items-center ";
let icon = null;
if (selectedAnswer === null) {
buttonClass += "border-gray-200 bg-white hover:border-blue-400 hover:bg-blue-50 text-gray-700";
} else if (option === quizData[currentQuestionIndex].answer) {
buttonClass += "border-green-500 bg-green-50 text-green-700 shadow-md";
icon = ;
} else if (selectedAnswer === option) {
buttonClass += "border-red-500 bg-red-50 text-red-700 shadow-md";
icon = ;
} else {
buttonClass += "border-gray-200 bg-gray-50 text-gray-400 opacity-50";
}
return (
);
})}
أحسنت يا بطل!
لقد أنهيت تدريبات القاموس اللغوي
نتيجتك هي:
{score} / {quizData.length}
{/* Stars based on score */}
{[...Array(quizData.length)].map((_, i) => (
))}

0 تعليقات