Changeset 50f2fb4 for src/app/students/documents
- Timestamp:
- 01/30/26 01:40:27 (8 months ago)
- Branches:
- master
- Children:
- ba52069
- Parents:
- 298f9b3
- File:
-
- 1 edited
-
src/app/students/documents/page.tsx (modified) (26 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/app/students/documents/page.tsx
r298f9b3 r50f2fb4 15 15 import { useState } from 'react'; 16 16 import documentsData from '@/data/documents.json'; 17 import { useTranslation } from 'react-i18next'; 17 18 18 19 interface TableCellProps { … … 28 29 29 30 const StatusBadge = ({ status }: { status: string }) => { 30 if (status === "approved") { 31 const { t } = useTranslation(); 32 if (status === t('approved', 'Одобрено')) { 31 33 return ( 32 34 <span className="inline-flex items-center justify-center w-8 h-8 bg-green-100 text-green-600 rounded-full"> … … 43 45 44 46 const PriceBadge = ({ price }: { price: number }) => { 47 const { t } = useTranslation(); 45 48 if (price === 0) { 46 return <span className="font-medium text-green-600"> 0,00</span>;49 return <span className="font-medium text-green-600">{t('free', '0,00')}</span>; 47 50 } 48 51 return <span className="font-medium text-blue-600">{price.toFixed(2)}</span>; … … 55 58 const [currentPage, setCurrentPage] = useState(1); 56 59 const [recordsPerPage, setRecordsPerPage] = useState(15); 60 const { t } = useTranslation(); 57 61 58 62 const selectedDocument = documentsData.documentTypes.find(d => d.id === selectedDocumentType); … … 73 77 </div> 74 78 <div> 75 <h1 className="text-3xl font-bold mb-2"> Документи</h1>79 <h1 className="text-3xl font-bold mb-2">{t('documents')}</h1> 76 80 <p className="text-lg opacity-90"> 77 Барање и преглед на документи81 {t('documents_overview', 'Преглед на вашите документи и нивниот статус.')} 78 82 </p> 79 83 </div> … … 85 89 <h2 className="text-lg font-semibold text-gray-900 mb-6 flex items-center gap-2"> 86 90 <FontAwesomeIcon icon={faFileText} className="text-primary" /> 87 Ново барање за документ91 {t('new_document_request', 'Ново барање за документ')} 88 92 </h2> 89 93 … … 92 96 <div> 93 97 <label className="block text-sm font-medium text-gray-700 mb-2"> 94 Изберете документ:98 {t('select_document', 'Избери документ')}: 95 99 </label> 96 100 <div className="relative"> … … 101 105 <div className="flex items-center justify-between"> 102 106 <span className="text-sm text-gray-900 truncate"> 103 {selectedDocument ?.name || "Изберете документ"}107 {selectedDocument ? t(selectedDocument.id) : t('select_document', 'Избери документ')} 104 108 </span> 105 109 <FontAwesomeIcon … … 121 125 className="w-full px-4 py-3 text-left text-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-50 border-b border-gray-100 last:border-b-0" 122 126 > 123 <div className="font-medium text-gray-900">{ docType.name}</div>127 <div className="font-medium text-gray-900">{t(docType.id)}</div> 124 128 {docType.price > 0 && ( 125 <div className="text-xs text-blue-600 mt-1"> Цена: {docType.price} мкд</div>129 <div className="text-xs text-blue-600 mt-1">{t('price', 'Цена')}: {docType.price} мкд</div> 126 130 )} 127 131 </button> … … 135 139 <div> 136 140 <label className="block text-sm font-medium text-gray-700 mb-2"> 137 Коментар:141 {t('comment', 'Коментар')}: 138 142 </label> 139 143 <textarea … … 142 146 rows={4} 143 147 className="w-full border border-gray-300 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary resize-none" 144 placeholder= "Додајте коментар..."148 placeholder={t('add_comment', 'Додај коментар')} 145 149 /> 146 150 </div> … … 153 157 > 154 158 <FontAwesomeIcon icon={faFileText} className="w-4 h-4" /> 155 Внеси159 {t('submit', 'Поднеси')} 156 160 </button> 157 161 </div> … … 161 165 <div className="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden"> 162 166 <div className="bg-primary text-white px-6 py-4"> 163 <h2 className="text-xl font-bold"> Мои документи</h2>167 <h2 className="text-xl font-bold">{t('my_documents', 'Мои документи')}</h2> 164 168 </div> 165 169 … … 169 173 <tr> 170 174 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">#</th> 171 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Архива</th>172 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Датум</th>173 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Барање</th>174 <th className="px-4 py-4 text-right text-xs font-medium text-gray-500 uppercase tracking-wider"> Цена</th>175 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"> Платено</th>176 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"> Документ</th>177 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"> Плати онлајн</th>178 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"> Статус</th>179 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"> Коментар</th>175 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('archive', 'Архива')}</th> 176 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('date', 'Датум')}</th> 177 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('request', 'Барање')}</th> 178 <th className="px-4 py-4 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">{t('price', 'Цена')}</th> 179 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">{t('paid', 'Платено')}</th> 180 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">{t('document', 'Документ')}</th> 181 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">{t('pay_online', 'Плати онлајн')}</th> 182 <th className="px-4 py-4 text-center text-xs font-medium text-gray-500 uppercase tracking-wider">{t('status', 'Статус')}</th> 183 <th className="px-4 py-4 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">{t('comment', 'Коментар')}</th> 180 184 </tr> 181 185 </thead> … … 187 191 <TableCell className="text-gray-600">{document.date}</TableCell> 188 192 <TableCell className="font-medium text-gray-900 max-w-xs"> 189 { document.request}193 {t(document.request)} 190 194 </TableCell> 191 195 <TableCell className="text-right"> … … 206 210 <FontAwesomeIcon icon={faCheckCircle} className="w-5 h-5 text-green-600" /> 207 211 ) : ( 208 <span className="text-gray-400"> —</span>212 <span className="text-gray-400">{t('none', '—')}</span> 209 213 )} 210 214 </TableCell> … … 214 218 <TableCell> 215 219 {document.comment || ( 216 <span className="text-gray-400"> —</span>220 <span className="text-gray-400">{t('none', '—')}</span> 217 221 )} 218 222 </TableCell> … … 227 231 <div className="flex items-center gap-4 text-sm text-gray-700"> 228 232 <div className="flex items-center gap-2"> 229 <span> Прикажи редови:</span>233 <span>{t('show_rows', 'Прикажи редови')}:</span> 230 234 <select 231 235 value={recordsPerPage} … … 239 243 </div> 240 244 <div> 241 Страна<input245 {t('page', 'Страница')} <input 242 246 type="number" 243 247 min="1" … … 246 250 onChange={(e) => setCurrentPage(Number(e.target.value))} 247 251 className="w-12 border border-gray-300 rounded px-2 py-1 text-sm text-center focus:outline-none focus:ring-1 focus:ring-primary" 248 /> од{totalPages}252 /> {t('of', 'од')} {totalPages} 249 253 </div> 250 254 </div> … … 266 270 </button> 267 271 <span className="px-4 py-2 bg-primary text-white rounded text-sm font-medium"> 268 Прва272 {t('first', 'Прва')} 269 273 </span> 270 274 <button … … 283 287 </button> 284 288 <span className="ml-4 text-sm text-gray-700"> 285 Последна289 {t('last', 'Последна')} 286 290 </span> 287 291 </div> 288 292 289 293 <div className="text-sm text-gray-700"> 290 Вкупно: {documents.length}294 {t('total', 'Вкупно')}: {documents.length} 291 295 </div> 292 296 </div> … … 297 301 <FontAwesomeIcon icon={faMoneyBillWave} className="w-5 h-5 text-blue-600 mt-0.5 flex-shrink-0" /> 298 302 <p className="text-sm text-blue-800 leading-relaxed"> 299 { paymentInfo}303 {t('documents_payment_info', paymentInfo)} 300 304 </p> 301 305 </div> … … 311 315 </div> 312 316 <div> 313 <h3 className="text-lg font-bold text-gray-900"> Вкупно документи</h3>317 <h3 className="text-lg font-bold text-gray-900">{t('total_documents', 'Вкупно документи')}</h3> 314 318 <p className="text-2xl font-bold text-blue-600"> 315 319 {documents.length} … … 325 329 </div> 326 330 <div> 327 <h3 className="text-lg font-bold text-gray-900"> Одобрени</h3>331 <h3 className="text-lg font-bold text-gray-900">{t('approved', 'Одобрени')}</h3> 328 332 <p className="text-2xl font-bold text-green-600"> 329 333 {documents.filter(doc => doc.status === "approved").length} … … 339 343 </div> 340 344 <div> 341 <h3 className="text-lg font-bold text-gray-900"> Вкупна цена</h3>345 <h3 className="text-lg font-bold text-gray-900">{t('total_price', 'Вкупна цена')}</h3> 342 346 <p className="text-2xl font-bold text-yellow-600"> 343 {documents.reduce((sum, doc) => sum + doc.price, 0).toFixed(2)} мкд347 {documents.reduce((sum, doc) => sum + doc.price, 0).toFixed(2)} {t('mkd', 'мкд')} 344 348 </p> 345 349 </div>
Note:
See TracChangeset
for help on using the changeset viewer.
