"use client"
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import {
faPenToSquare,
faChevronDown,
faCalendarAlt,
faFileText,
faMoneyBillWave,
faUser,
faInfoCircle,
faCheckCircle,
faTimesCircle
} from '@fortawesome/free-solid-svg-icons';
import { useState } from 'react';
import applicationsData from '@/data/applications.json';
interface TableCellProps {
children: React.ReactNode;
className?: string;
}
const TableCell = ({ children, className = "" }: TableCellProps) => (
{children}
|
);
const CompletedBadge = ({ completed }: { completed: string }) => {
if (completed === "Да") {
return (
);
} else {
return (
);
}
};
const FeeBadge = ({ fee }: { fee: string }) => {
const feeValue = parseFloat(fee.replace(',', '.'));
if (feeValue === 0) {
return (
{fee}
);
} else {
return (
{fee}
);
}
};
export default function ApplicationsPage() {
const [selectedSession, setSelectedSession] = useState(applicationsData.currentSession.id);
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
const currentSessionData = applicationsData.examSessions.find(s => s.id === selectedSession) || applicationsData.currentSession;
const { applications } = applicationsData;
return (
{/* Header */}
Пријави
Електронски пријави за испити
{/* Session Selection */}
Избери испитна сесија:
{isDropdownOpen && (
{applicationsData.examSessions.map((session) => (
))}
)}
{/* Applications Section */}
Пријавени испити
| # |
Сериски број |
Код |
Предмет |
Завршена |
Таксени |
Датум |
Наставник |
Декада |
{applications.map((application) => (
{application.id}
{application.serviceNumber}
{application.code}
{application.subject}
{application.date}
{application.instructor}
{application.decade}
))}
{/* Important Note */}
Важна забелешка
{applicationsData.note}
{/* Statistics Cards */}
Пријавени испити
{applications.length}
Завршени
{applications.filter(app => app.completed === "Да").length}
Вкупна такса
{applications.reduce((sum, app) => sum + parseFloat(app.fee.replace(',', '.')), 0).toFixed(2)}
);
}