import{e as d,r as e,j as r,f}from"./index-sga-FecS.js";import{u as m}from"./DefaultLayout-R679muSx.js";import{b as p}from"./index.esm-7CdJvro0.js";import{C as h,a as x}from"./CRow-BaMSc2yS.js";import"./university-logo-full-HPG0vyLU.js";import"./cil-user-Dlmw-Gem.js";function w(){const{t:o}=d(),{user:s,loading:l,error:u}=m(),[g,a]=e.useState(!0),[j,n]=e.useState(null),[i,c]=e.useState(null);return e.useEffect(()=>{(async()=>{try{a(!0),n(null);const t=await f.get("/api/users/student-profile/");c(t.data)}catch(t){console.error("Error loading user profile:",t),n(!0)}finally{a(!1)}})()},[]),l?r.jsx("div",{children:"Loading..."}):u?r.jsx("div",{children:"Error loading user."}):s.role!=="registrar"?r.jsx("div",{children:"Unauthorized"}):(i?.progress_percent,i?.current_stage,r.jsx(p,{fluid:!0,className:"py-4",children:r.jsx(h,{className:"mb-4",children:r.jsxs(x,{xs:"12",children:[r.jsx("h2",{className:"mb-1",children:o("registrar_dashboard")}),r.jsxs("p",{className:"text-medium-emphasis mb-0",children:[o("registrar_dashboard_welcome")," ",r.jsx("strong",{children:s?.full_name||s?.username})]})]})})}))}export{w as default};
