source: src/app/students/profile/page.tsx@ 82c9c53

Last change on this file since 82c9c53 was 82c9c53, checked in by stefansaveski <stefansaveski19@…>, 11 months ago

refactor: Remove unused imports and optimize component code across multiple files

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