import{e as f,r,j as s,f as p}from"./index-sga-FecS.js";import{u as j}from"./DefaultLayout-R679muSx.js";import{b as _}from"./index.esm-7CdJvro0.js";import{C as o,a}from"./CRow-BaMSc2yS.js";import{C as n,a as d}from"./CCardBody-e8lVonr1.js";import"./university-logo-full-HPG0vyLU.js";import"./cil-user-Dlmw-Gem.js";function L(){const{t:e}=f(),{user:t,loading:u,error:h}=j(),[b,l]=r.useState(!0),[N,c]=r.useState(null),[m,x]=r.useState(null);return r.useEffect(()=>{(async()=>{try{l(!0),c(null);const i=await p.get("/api/users/student-profile/");x(i.data)}catch(i){console.error("Error loading user profile:",i),c(!0)}finally{l(!1)}})()},[]),u?s.jsx("div",{children:"Loading..."}):h?s.jsx("div",{children:"Error loading user."}):t.role!=="admin"?s.jsx("div",{children:"Unauthorized"}):(m?.progress_percent,m?.current_stage,s.jsxs(_,{fluid:!0,className:"py-4",children:[s.jsx(o,{className:"mb-4",children:s.jsxs(a,{xs:"12",children:[s.jsx("h2",{className:"mb-1",children:e("admin_dashboard")}),s.jsxs("p",{className:"text-medium-emphasis mb-0",children:[e("admin_dashboard_welcome")," ",s.jsx("strong",{children:t?.full_name||t?.username})]})]})}),s.jsxs(o,{children:[s.jsx(a,{xs:"12",md:"4",className:"mb-4",children:s.jsx(n,{className:"h-100 border-success border-start-4",children:s.jsxs(d,{children:[s.jsx("div",{className:"text-medium-emphasis small mb-1",children:e("student_card_registration")}),s.jsx("h5",{className:"mb-2",children:e("student_card_registration_title")}),s.jsx("p",{className:"text-medium-emphasis mb-0",children:e("student_card_registration_desc")})]})})}),s.jsx(a,{xs:"12",md:"4",className:"mb-4",children:s.jsx(n,{className:"h-100 border-info border-start-4",children:s.jsxs(d,{children:[s.jsx("div",{className:"text-medium-emphasis small mb-1",children:e("student_card_courses")}),s.jsx("h5",{className:"mb-2",children:e("student_card_courses_title")}),s.jsx("p",{className:"text-medium-emphasis mb-0",children:e("student_card_courses_desc")})]})})}),s.jsx(a,{xs:"12",md:"4",className:"mb-4",children:s.jsx(n,{className:"h-100 border-warning border-start-4",children:s.jsxs(d,{children:[s.jsx("div",{className:"text-medium-emphasis small mb-1",children:e("student_card_finance")}),s.jsx("h5",{className:"mb-2",children:e("student_card_finance_title")}),s.jsx("p",{className:"text-medium-emphasis mb-0",children:e("student_card_finance_desc")})]})})})]})]}))}export{L as default};
