Changeset 50f2fb4 for src/components/exams.tsx
- Timestamp:
- 01/30/26 01:40:27 (8 months ago)
- Branches:
- master
- Children:
- ba52069
- Parents:
- 298f9b3
- File:
-
- 1 edited
-
src/components/exams.tsx (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/components/exams.tsx
r298f9b3 r50f2fb4 1 1 "use client" 2 2 import { useEffect, useMemo, useState } from 'react'; 3 import { useTranslation } from 'react-i18next'; 3 4 import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; 4 5 import { faSort, faSortUp, faSortDown } from '@fortawesome/free-solid-svg-icons'; … … 33 34 34 35 const Exams = () => { 36 const { t } = useTranslation(); 35 37 const [sortField, setSortField] = useState<'grade' | 'date' | null>(null); 36 38 const [sortOrder, setSortOrder] = useState<'asc' | 'desc' | null>(null); … … 185 187 return ( 186 188 <div className="bg-white rounded-lg shadow-sm p-6"> 187 Loading...189 {t('loading', 'Loading...')} 188 190 </div> 189 191 ); … … 194 196 <div className="bg-white rounded-lg shadow-sm p-6"> 195 197 <div className="rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700"> 196 { errorMessage}198 {t('failed_to_load_exams', errorMessage)} 197 199 </div> 198 200 </div> … … 208 210 <div className="text-center"> 209 211 <div className="text-3xl font-bold text-gray-900">{stats.average}</div> 210 <div className="text-sm text-gray-500 mt-1"> Просек</div>212 <div className="text-sm text-gray-500 mt-1">{t('average', 'Просек')}</div> 211 213 </div> 212 214 … … 217 219 <span className="text-lg text-gray-400">/{stats.credits.total}</span> 218 220 </div> 219 <div className="text-sm text-gray-500 mt-1"> Кредити</div>221 <div className="text-sm text-gray-500 mt-1">{t('credits', 'Кредити')}</div> 220 222 </div> 221 223 … … 223 225 <div className="text-center"> 224 226 <div className="text-3xl font-bold text-gray-900">{stats.passed}</div> 225 <div className="text-sm text-gray-500 mt-1"> Положени</div>227 <div className="text-sm text-gray-500 mt-1">{t('passed', 'Положени')}</div> 226 228 </div> 227 229 … … 229 231 <div className="text-center"> 230 232 <div className="text-3xl font-bold text-gray-900">{stats.remaining}</div> 231 <div className="text-sm text-gray-500 mt-1"> Останато</div>233 <div className="text-sm text-gray-500 mt-1">{t('remaining', 'Останато')}</div> 232 234 </div> 233 235 </div> 234 236 235 237 {/* Progress Bar spanning entire statistics section */} 236 238 <div className="w-full bg-gray-200 rounded-full h-2"> 237 <div 239 <div 238 240 className="bg-blue-500 h-2 rounded-full transition-all duration-300" 239 241 style={{ width: `${creditsPercentage}%` }} … … 244 246 {/* Exams Table */} 245 247 <div> 246 <h3 className="text-xl font-semibold text-gray-900 mb-4"> Испити</h3>247 248 <h3 className="text-xl font-semibold text-gray-900 mb-4">{t('exams', 'Испити')}</h3> 249 248 250 <div className="overflow-x-auto"> 249 251 <table className="min-w-full"> … … 251 253 <tr className="border-b border-gray-200"> 252 254 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500">#</th> 253 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500"> Предмет</th>254 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500"> Семестар</th>255 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500"> Кредити</th>255 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500">{t('subject', 'Предмет')}</th> 256 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500">{t('semester', 'Семестар')}</th> 257 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500">{t('credits', 'Кредити')}</th> 256 258 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500"> 257 <button 259 <button 258 260 onClick={handleSortByDate} 259 261 className="flex items-center gap-2 px-2 py-1 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-all duration-200 transform hover:scale-105" 260 262 > 261 Датум262 <FontAwesomeIcon 263 icon={getSortIcon('date')} 263 {t('date', 'Датум')} 264 <FontAwesomeIcon 265 icon={getSortIcon('date')} 264 266 className={`text-xs transition-colors duration-200 ${ 265 267 sortField === 'date' ? 'text-blue-600' : 'text-gray-400 group-hover:text-gray-600' … … 269 271 </th> 270 272 <th className="text-left py-3 px-4 text-sm font-medium text-gray-500"> 271 <button 273 <button 272 274 onClick={handleSortByGrade} 273 275 className="flex items-center gap-2 px-2 py-1 rounded-md hover:bg-gray-100 hover:text-gray-900 transition-all duration-200 transform hover:scale-105" 274 276 > 275 Оценка276 <FontAwesomeIcon 277 icon={getSortIcon('grade')} 277 {t('grade', 'Оценка')} 278 <FontAwesomeIcon 279 icon={getSortIcon('grade')} 278 280 className={`text-xs transition-colors duration-200 ${ 279 281 sortField === 'grade' ? 'text-blue-600' : 'text-gray-400 group-hover:text-gray-600'
Note:
See TracChangeset
for help on using the changeset viewer.
