source: src/app/students/profile/page.tsx@ 2d635ae

Last change on this file since 2d635ae was 6b8332f, checked in by stefansaveski <stefansaveski19@…>, 11 months ago

feat: Add student exams, profile, semesters, and subjects pages with respective components and data integration

  • Property mode set to 100644
File size: 8.1 KB
Line 
1"use client"
2
3import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4import {
5 faUser,
6 faIdCard,
7 faGraduationCap,
8 faAddressCard,
9 faSchool,
10 faCalendarAlt,
11 faFlag,
12 faVenus,
13 faMars,
14 faEnvelope,
15 faPhone,
16 faMapMarkerAlt,
17 faPassport
18} from '@fortawesome/free-solid-svg-icons';
19import studentData from '@/data/student-profile.json';
20
21interface InfoRowProps {
22 label: string;
23 value: string | number;
24 icon?: any;
25}
26
27const InfoRow = ({ label, value, icon }: InfoRowProps) => (
28 <div className="flex justify-between items-center py-3 border-b border-gray-100 last:border-b-0">
29 <div className="flex items-center gap-2 text-gray-600 font-medium">
30 {icon && <FontAwesomeIcon icon={icon} className="w-4 h-4" />}
31 <span>{label}:</span>
32 </div>
33 <div className="text-gray-900 font-semibold text-right max-w-xs break-words">
34 {value || "N/A"}
35 </div>
36 </div>
37);
38
39interface SectionProps {
40 title: string;
41 icon: any;
42 children: React.ReactNode;
43}
44
45const Section = ({ title, icon, children }: SectionProps) => (
46 <div className="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
47 <div className="bg-primary text-white px-6 py-4">
48 <div className="flex items-center gap-3">
49 <FontAwesomeIcon icon={icon} className="text-xl" />
50 <h2 className="text-xl font-bold">{title}</h2>
51 </div>
52 </div>
53 <div className="p-6">
54 {children}
55 </div>
56 </div>
57);
58
59export default function ProfilePage() {
60 const { personalInfo, birthInfo, previousEducation, enrollmentInfo, contact } = studentData;
61
62 return (
63 <div className="min-h-screen pb-8">
64 {/* Header */}
65 <div className="bg-primary text-white rounded-xl p-8 mb-8">
66 <div className="flex items-center gap-6">
67 <div className="relative">
68 <div className="w-20 h-20 bg-white bg-opacity-20 rounded-full flex items-center justify-center border-2 border-white border-opacity-30">
69 <FontAwesomeIcon icon={faUser} className="text-3xl text-primary" />
70 </div>
71 <div className="absolute -bottom-1 -right-1 w-6 h-6 bg-green-500 rounded-full border-2 border-white"></div>
72 </div>
73 <div>
74 <h1 className="text-3xl font-bold mb-2">
75 {personalInfo.firstName} {personalInfo.middleName} {personalInfo.lastName}
76 </h1>
77 <div className="text-lg opacity-90">
78 Индекс: {personalInfo.index} | ЕМБГ: {personalInfo.embg}
79 </div>
80 <div className="text-base opacity-80 mt-1">
81 {enrollmentInfo.program}
82 </div>
83 </div>
84 </div>
85 </div>
86
87 {/* Profile Sections */}
88 <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
89
90 {/* Personal Information */}
91 <Section title="Лични податоци" icon={faIdCard}>
92 <InfoRow label="Име" value={personalInfo.firstName} />
93 <InfoRow label="Средно име" value={personalInfo.middleName} />
94 <InfoRow label="Презиме" value={personalInfo.lastName} />
95 <InfoRow label="Моминско презиме" value={personalInfo.maidenName} />
96 <InfoRow
97 label="Датум на раѓање"
98 value={personalInfo.dateOfBirth}
99 icon={faCalendarAlt}
100 />
101 <InfoRow
102 label="Пол"
103 value={personalInfo.gender}
104 icon={personalInfo.gender === 'машки' ? faMars : faVenus}
105 />
106 <InfoRow
107 label="Националност"
108 value={personalInfo.nationality}
109 icon={faFlag}
110 />
111 <InfoRow label="Државјанство" value={personalInfo.citizenship} />
112 <InfoRow label="Стипендија" value={personalInfo.scholarship} />
113 <InfoRow label="Тековен план" value={personalInfo.currentPlan} />
114 <InfoRow label="Бр. во матична книга" value={personalInfo.registryNumber} />
115 <InfoRow label="Група на студирање" value={personalInfo.studyGroup} />
116 {personalInfo.notes && (
117 <div className="mt-4 p-4 bg-blue-50 rounded-lg">
118 <div className="text-sm font-medium text-blue-800 mb-1">Забелешка:</div>
119 <div className="text-sm text-blue-700">{personalInfo.notes}</div>
120 </div>
121 )}
122 </Section>
123
124 {/* Birth Information */}
125 <Section title="Податоци за раѓање" icon={faMapMarkerAlt}>
126 <InfoRow label="Место на раѓање" value={birthInfo.placeOfBirth} />
127 <InfoRow label="Општина на раѓање" value={birthInfo.municipalityOfBirth} />
128 <InfoRow label="Земја" value={birthInfo.country} />
129 </Section>
130
131 {/* Previous Education */}
132 <Section title="Претходно образование" icon={faSchool}>
133 <InfoRow label="Тип" value={previousEducation.type} />
134 <InfoRow label="Професија" value={previousEducation.profession} />
135 <InfoRow label="Просек" value={previousEducation.average} />
136 <InfoRow label="Јазик" value={previousEducation.language} />
137 <InfoRow label="Земја" value={previousEducation.country} />
138 <InfoRow label="Претходен универзитет" value={previousEducation.previousUniversity} />
139 <InfoRow label="Претходен факултет" value={previousEducation.previousFaculty} />
140 <InfoRow label="Режим на претходни студии" value={previousEducation.previousStudyMode} />
141 </Section>
142
143 {/* Enrollment Information */}
144 <Section title="Податоци за упис" icon={faGraduationCap}>
145 <InfoRow label="Година на упис" value={enrollmentInfo.enrollmentYear} />
146 <InfoRow label="Статус" value={enrollmentInfo.status} />
147 <InfoRow label="Циклус" value={enrollmentInfo.cycle} />
148 <InfoRow label="Запишана програма" value={enrollmentInfo.program} />
149 <InfoRow label="Квота на прв упис" value={enrollmentInfo.quota} />
150 <InfoRow label="Бр. дипл. ср. образование" value={enrollmentInfo.secondaryEducationNumber} />
151 <InfoRow label="Кред. пр. образование" value={enrollmentInfo.previousEducationCredits} />
152 </Section>
153
154 {/* Contact Information */}
155 <div className="lg:col-span-2">
156 <Section title="Контакт" icon={faAddressCard}>
157 <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
158 <div>
159 <InfoRow
160 label="Место на живеење"
161 value={contact.placeOfResidence}
162 icon={faMapMarkerAlt}
163 />
164 <InfoRow label="Општина на живеење" value={contact.municipalityOfResidence} />
165 <InfoRow label="Држава" value={contact.country} />
166 <InfoRow label="Адреса" value={contact.address} />
167 <InfoRow label="Адреса на престој" value={contact.temporaryAddress} />
168 </div>
169 <div>
170 <InfoRow label="Телефон" value={contact.phone} icon={faPhone} />
171 <InfoRow label="Моб. телефон" value={contact.mobilePhone} icon={faPhone} />
172 <InfoRow label="Број на пасош" value={contact.passportNumber} icon={faPassport} />
173 <InfoRow label="Датум на истекување на пасошот" value={contact.passportExpiryDate} />
174 <InfoRow
175 label="Е-пошта"
176 value={contact.email}
177 icon={faEnvelope}
178 />
179 <InfoRow
180 label="Microsoft email"
181 value={contact.microsoftEmail}
182 icon={faEnvelope}
183 />
184 </div>
185 </div>
186 </Section>
187 </div>
188 </div>
189 </div>
190 );
191}
Note: See TracBrowser for help on using the repository browser.