"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[54808],{54808:(e,l,a)=>{a.r(l),a.d(l,{default:()=>c});var s=a(95155),t=a(12115),r=a(30571),o=a(30313),i=a(75560),n=a(2581),u=a(90927);function d({title:e,children:l}){return(0,s.jsx)(o.cP,{title:e,children:l})}function c(){let[e,l]=(0,t.useState)(null),[a,c]=(0,t.useState)(!0);(0,t.useEffect)(()=>{let e=!1;return(0,i.W_)().then(a=>{e||l(a)}).catch(l=>{e||(0,n.Qg)(l instanceof Error?l.message:"Failed to load your details")}).finally(()=>{e||c(!1)}),()=>{e=!0}},[]);let m=e?.user,h=e?.profile,x=e?.enrollment,j=x?.schoolClass?.displayName,b=(0,u.oG)(m?.profileImage),v=(m?.fullName||"?").split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join("");return(0,s.jsx)(r.o,{title:"My details",description:"Your admission and contact information on file with the school.",children:a?(0,s.jsxs)("div",{className:"space-y-4 animate-pulse",children:[(0,s.jsx)("div",{className:"h-28 rounded-lg bg-slate-100"}),(0,s.jsx)("div",{className:"h-40 rounded-lg bg-slate-100"}),(0,s.jsx)("div",{className:"h-40 rounded-lg bg-slate-100"})]}):e?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-4 rounded-lg border border-slate-100 bg-white p-5 shadow-sm sm:flex-row sm:items-center",children:[(0,s.jsx)("div",{className:"flex h-16 w-16 shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary-50 text-lg font-semibold text-primary-800",children:m?.profileImage?b?(0,s.jsx)("img",{src:b,alt:"",className:"h-full w-full object-cover"}):null:v}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xl font-semibold text-slate-900",children:m?.fullName||"Student"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:[j,m?.studentCode?`ID ${m.studentCode}`:null,x?.rollNumber?`Roll ${x.rollNumber}`:null].filter(Boolean).join(" \xb7 ")||"Enrolled student"})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:[(0,s.jsxs)(d,{title:"Account",children:[(0,s.jsx)(o.CL,{label:"Full name",value:m?.fullName}),(0,s.jsx)(o.CL,{label:"Email",value:m?.email}),(0,s.jsx)(o.CL,{label:"Phone",value:m?.phone}),(0,s.jsx)(o.CL,{label:"Student code",value:m?.studentCode})]}),(0,s.jsxs)(d,{title:"Class & admission",children:[(0,s.jsx)(o.CL,{label:"Class",value:j}),(0,s.jsx)(o.CL,{label:"Roll number",value:x?.rollNumber}),(0,s.jsx)(o.CL,{label:"Admission number",value:h?.admissionNumber}),(0,s.jsx)(o.CL,{label:"Admission date",value:h?.admissionDate}),(0,s.jsx)(o.CL,{label:"Category",value:h?.category?.name}),(0,s.jsx)(o.CL,{label:"Group",value:h?.group?.name}),(0,s.jsx)(o.CL,{label:"Previous school",value:h?.previousSchool})]}),(0,s.jsxs)(d,{title:"Personal",children:[(0,s.jsx)(o.CL,{label:"Date of birth",value:h?.dateOfBirth}),(0,s.jsx)(o.CL,{label:"Gender",value:h?.gender}),(0,s.jsx)(o.CL,{label:"Blood group",value:h?.bloodGroup}),(0,s.jsx)(o.CL,{label:"Address",value:h?.address}),(0,s.jsx)(o.CL,{label:"City",value:h?.city}),(0,s.jsx)(o.CL,{label:"District",value:h?.district}),(0,s.jsx)(o.CL,{label:"Country",value:h?.country})]}),(0,s.jsxs)(d,{title:"Parents & guardian",children:[(0,s.jsx)(o.CL,{label:"Father",value:h?.fatherName}),(0,s.jsx)(o.CL,{label:"Father phone",value:h?.fatherPhone}),(0,s.jsx)(o.CL,{label:"Father email",value:h?.fatherEmail}),(0,s.jsx)(o.CL,{label:"Mother",value:h?.motherName}),(0,s.jsx)(o.CL,{label:"Mother phone",value:h?.motherPhone}),(0,s.jsx)(o.CL,{label:"Mother email",value:h?.motherEmail}),(0,s.jsx)(o.CL,{label:"Guardian",value:h?.guardianName}),(0,s.jsx)(o.CL,{label:"Guardian relation",value:h?.guardianRelation?`${h.guardianRelation}${h.guardianPhone?` \xb7 ${h.guardianPhone}`:""}`:h?.guardianPhone})]})]})]}):(0,s.jsx)(o.i0,{title:"Could not load your record",description:"Ask your school office if you need help accessing your student profile."})})}}}]);