PageSourceSearch

https://hticu.netlify.app/assets/Dashboard-BHSqSjzb.js

js hticu.netlify.app collected 2026-10-03 10:53:39 UTC 9,287 bytes, 2 lines download raw bytes

1import{j as e}from"./ui-vendor-xlsKxNXq.js";import{r as s}from"./react-vendor-DkrMGtWY.js";import{u as t,a}from"./query-vendor-C49mE9eM.js";import{k as i,l as n,m as l,n as d,b2 as r,aR as c,a2 as o,a4 as m,g as p,i as u,h as x,F as h,R as j}from"./index-BXeScBeb.js";import{u as f}from"./use-stage-automation-DpOEoRcU.js";import{f as g}from"./format-CMLi9FdX.js";import"./form-vendor-BZ2PJDNq.js";const y=[{key:"lead",label:"Inquiry Received",description:"We've received your interest"},{key:"contacted",label:"Contact Made",description:"Our team has reached out"},{key:"application_started",label:"Application Started",description:"You've begun your application"},{key:"application_submitted",label:"Application Submitted",description:"We've received your completed application"},{key:"documents_pending",label:"Documents Review",description:"Reviewing your supporting documents"},{key:"under_review",label:"Under Review",description:"Application is being evaluated"},{key:"interview_scheduled",label:"Interview Scheduled",description:"Interview with admissions team"},{key:"accepted",label:"Accepted",description:"Congratulations! You've been accepted"},{key:"enrolled",label:"Enrolled",description:"You're officially enrolled"}],v=({currentStage:s})=>{const t=y.findIndex(e=>e.key===s);return e.jsxs(i,{className:"glass",children:[e.jsx(n,{children:e.jsx(l,{className:"text-fluid-lg",children:"Application Progress"})}),e.jsx(d,{children:e.jsx("div",{className:"space-y-4",children:y.map((s,a)=>{const i=a<t,n=a===t;return e.jsxs("div",{className:"flex gap-4 items-start",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"rounded-full p-2 "+(i?"bg-primary text-primary-foreground":n?"bg-accent text-accent-foreground":"bg-muted text-muted-foreground"),children:i?e.jsx(r,{className:"h-4 w-4"}):e.jsx(c,{className:"h-4 w-4"})}),a<y.length-1&&e.jsx("div",{className:"w-0.5 h-12 "+(i?"bg-primary":"bg-muted")})]}),e.jsxs("div",{className:"flex-1 pb-8",children:[e.jsx("h3",{className:"font-semibold "+(n?"text-accent":""),children:s.label}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.description})]})]},s.key)})})})]})},N=()=>{var r,c;const y=t();s.useEffect(()=>{window.scrollTo(0,0)},[]);const{data:N}=a({queryKey:["profile"],queryFn:async()=>{const{data:{session:e}}=await o.auth.getSession();if(!e)return null;const{data:s}=await o.from("profiles").select("*").eq("user_id",e.user.id).single();return s}}),{data:b,isLoading:w}=a({queryKey:["application",null==N?void 0:N.id],queryFn:async()=>{if(!(null==N?void 0:N.id))return null;const{data:e}=await o.from("applications").select("*").eq("profile_id",N.id).order("created_at",{ascending:!1}).limit(1).single();return e},enabled:!!(null==N?void 0:N.id)});f(b?{id:b.id,pipeline_stage:b.pipeline_stage,application_fee_paid:b.application_fee_paid,total_documents:b.total_documents||0,approved_documents:b.approved_documents||0,pending_documents:b.pending_documents||0}:null);const{data:_}=a({queryKey:["unread-messages",null==b?void 0:b.id],queryFn:async()=>{if(!(null==b?void 0:b.id))return 0;const{count:e}=await o.from("messages").select("*",{count:"exact",head:!0}).eq("application_id",b.id).eq("is_read",!1);return e||0},enabled:!!(null==b?void 0:b.id)}),{data:q}=a({queryKey:["documents",null==b?void 0:b.id],queryFn:async()=>{if(!(null==b?void 0:b.id))return[];const{data:e}=await o.from("application_documents").select("*").eq("application_id",b.id);return e||[]},enabled:!!(null==b?void 0:b.id)});s.useEffect(()=>{if(!(null==b?void 0:b.id))return;const e=o.channel("applicant-dashboard-updates").on("postgres_changes",{event:"*",schema:"public",table:"applications",filter:`id=eq.${b.id}`},()=>y.invalidateQueries({queryKey:["application"]})).on("postgres_changes",{event:"*",schema:"public",table:"application_documents",filter:`application_id=eq.${b.id}`},()=>y.invalidateQueries({queryKey:["documents"]})).on("postgres_changes",{event:"*",schema:"public",table:"messages",filter:`application_id=eq.${b.id}`},()=>y.invalidateQueries({queryKey:["unread-messages"]})).subscribe();return()=>{o.removeChannel(e)}},[null==b?void 0:b.id,y]);return w?e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx(m,{className:"w-8 h-8 animate-spin text-primary"})}):b?e.jsxs("div",{className:"p-4 sm:p-6 lg:p-8 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold",children:["Welcome back, ",null==N?void 0:N.first_name,"!"]}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"Here's an overview of your application"})]}),e.jsx(v,{currentStage:b.pipeline_stage||"lead"}),e.jsxs(i,{children:[e.jsx(n,{children:e.jsx(l,{children:"Application Details"})}),e.jsxs(d,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Current Stage"}),e.jsx(p,{className:(e=>{switch(e){case"approved":return"bg-green-500";case"rejected":return"bg-red-500";case"under_review":return"bg-blue-500";
1case"pending":return"bg-yellow-500";default:return"bg-gray-500"}})(b.status||"pending"),children:(null==(r=b.pipeline_stage)?void 0:r.replace(/_/g," ").toUpperCase())||(null==(c=b.status)?void 0:c.replace("_"," ").toUpperCase())||"PENDING"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Program"}),e.jsx("p",{className:"font-medium",children:b.program_interest||"Not specified"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Submitted"}),e.jsx("p",{className:"font-medium",children:g(new Date(b.created_at),"MMM dd, yyyy")})]})]}),"paid"===b.payment_status&&e.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[e.jsx(u,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm font-medium",children:"Application fee paid"})]}),"paid"!==b.payment_status&&e.jsxs("div",{className:"flex items-center gap-2 text-yellow-600",children:[e.jsx(x,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm font-medium",children:"Payment pending"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 sm:gap-6",children:[e.jsxs(i,{children:[e.jsxs(n,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(l,{className:"text-sm font-medium",children:"Application Status"}),e.jsx(h,{className:"w-4 h-4 text-muted-foreground"})]}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold capitalize",children:b.status||"Pending"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Current application status"})]})]}),e.jsxs(i,{children:[e.jsxs(n,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(l,{className:"text-sm font-medium",children:"Documents"}),e.jsx(h,{className:"w-4 h-4 text-muted-foreground"})]}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold",children:(null==q?void 0:q.length)||0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Uploaded documents"})]})]}),e.jsxs(i,{children:[e.jsxs(n,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(l,{className:"text-sm font-medium",children:"Messages"}),e.jsx(j,{className:"w-4 h-4 text-muted-foreground"})]}),e.jsxs(d,{children:[e.jsx("div",{className:"text-2xl font-bold",children:_||0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Unread messages"})]})]})]}),e.jsxs(i,{children:[e.jsx(n,{children:e.jsx(l,{children:"Next Steps"})}),e.jsx(d,{children:e.jsxs("ul",{className:"space-y-3",children:["paid"!==b.payment_status&&e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(x,{className:"w-5 h-5 text-yellow-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Complete Payment"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your application fee payment is pending"})]})]}),(!q||0===q.length)&&e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(h,{className:"w-5 h-5 text-blue-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Upload Documents"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please upload any required supporting documents"})]})]}),(_||0)>0&&e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(j,{className:"w-5 h-5 text-primary mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"Check Messages"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You have ",_," unread message",1!==_?"s":""]})]})]}),"paid"===b.payment_status&&q&&q.length>0&&0===(_||0)&&e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(u,{className:"w-5 h-5 text-green-600 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"All Set!"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your application is complete. We'll notify you of any updates."})]})]})]})})]})]}):e.jsx("div",{className:"p-8",children:e.jsx(i,{children:e.jsx(d,{className:"pt-6",children:e.jsx("p",{className:"text-center text-muted-foreground",children:"No application found."})})})})};export{N as default};
2//# sourceMappingURL=Dashboard-BHSqSjzb.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.