PageSourceSearch

https://blisstherapy.ai/assets/admin.applications-CaWGxeqL.js

js blisstherapy.ai collected 2026-10-05 11:53:05 UTC 5,201 bytes, 1 lines download raw bytes

1import{r as p,f as h,b as j,g as f,t as x,j as e,B as d,L as b,T as g}from"./index-CwxMVMRT.js";import{l as N,r as v}from"./therapist-review-fns-DV0a_t1-.js";import{E as y}from"./external-link-C2fRzMWq.js";import{C as k}from"./circle-check-CDE33laf.js";import{C}from"./circle-x-BEm6pkhO.js";function T(){const[s,i]=p.useState("pending"),c=h(),{data:r,isPending:o}=j({queryKey:["therapist-applications",s],queryFn:()=>N({data:{status:s}})}),l=f({mutationFn:t=>v({data:t}),onSuccess:(t,n)=>{x.success(n.decision==="accepted"?"Accepted.":"Rejected — applicant notified."),c.invalidateQueries({queryKey:["therapist-applications"]})},onError:()=>x.error("Couldn't save that — please try again.")});return e.jsxs("div",{className:"mx-auto w-full max-w-4xl px-4 py-8",children:[e.jsxs("header",{children:[e.jsx("h1",{className:"font-serif text-2xl text-bliss-ink",children:"Therapist applications"}),e.jsx("p",{className:"mt-1 text-sm text-bliss-ink-soft",children:"Accepting lets a practitioner into their dashboard to set up. It does not publish them to the directory — that stays a separate step."})]}),e.jsx("div",{className:"mt-6 flex gap-2",children:["pending","accepted","rejected"].map(t=>e.jsx(d,{type:"button",size:"sm",variant:s===t?"default":"outline",className:"rounded-full capitalize",onClick:()=>i(t),children:t},t))}),o?e.jsx("div",{className:"mt-10 flex justify-center",children:e.jsx(b,{className:"h-5 w-5 animate-spin text-muted-foreground","aria-hidden":!0})}):!r||r.length===0?e.jsx("p",{className:"mt-10 text-center text-sm text-bliss-ink-soft",children:s==="pending"?"Nothing waiting. ":"Nothing here. "}):e.jsx("div",{className:"mt-6 grid gap-4",children:r.map(t=>e.jsx(A,{row:t,busy:l.isPending,onDecide:(n,a)=>l.mutate({therapistId:t.therapistId,decision:n,reason:a})},t.therapistId))})]})}function A({row:s,busy:i,onDecide:c}){const[r,o]=p.useState(!1),[l,t]=p.useState(""),n=[{label:"Government ID",url:s.govIdImageUrl},...(s.qualificationDocUrls??[]).map((a,u)=>({label:`Qualification ${u+1}`,url:a}))].filter(a=>!!a.url);return e.jsxs("div",{className:"rounded-2xl border border-border/60 bg-white p-5 shadow-sm",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-serif text-lg leading-tight text-bliss-ink",children:s.fullName??s.displayName??"—"}),e.jsx("p",{className:"text-sm text-bliss-ink-soft",children:s.email??"—"})]}),e.jsx("span",{className:"rounded-full bg-muted px-3 py-1 text-xs capitalize text-bliss-ink-soft",children:s.level??"—"})]}),e.jsxs("dl",{className:"mt-4 grid gap-2 text-sm md:grid-cols-2",children:[e.jsx(m,{label:"Qualification",value:s.qualification}),e.jsx(m,{label:"Licence number",value:s.licenseNumber}),e.jsx(m,{label:"Years of experience",value:s.yearsExperience==null?null:String(s.yearsExperience)}),e.jsx(m,{label:"Applied",value:s.submittedAt?new Date(s.submittedAt).toLocaleDateString():null})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-bliss-ink-soft",children:"Documents"}),n.length===0?e.jsx("p",{className:"mt-1.5 text-sm text-red-700",children:"No documents uploaded — nothing to verify against."}):e.jsx("div",{className:"mt-1.5 flex flex-wrap gap-2",children:n.map(a=>e.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full border border-border/60 px-3 py-1.5 text-xs text-bliss-ink hover:bg-muted",children:[a.label,e.jsx(y,{className:"h-3 w-3","aria-hidden":!0})]},a.url))})]}),s.reviewStatus==="rejected"&&s.rejectionReason?e.jsxs("p",{className:"mt-4 rounded-xl bg-amber-50/60 p-3 text-sm text-bliss-ink",children:[e.jsx("span",{className:"font-medium",children:"Reason given:"})," ",s.rejectionReason]}):null,s.reviewStatus==="pending"?e.jsx("div",{className:"mt-5",children:r?e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{value:l,onChange:a=>t(a.target.value),placeholder:"What does this applicant need to fix? They see this verbatim.",rows:3}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{type:"button",size:"sm",variant:"outline",className:"rounded-full border-red-300/70 text-red-700 hover:bg-red-50",disabled:i||l.trim().length===0,onClick:()=>c("rejected",l.trim()),children:"Send rejection"}),e.jsx(d,{type:"button",size:"sm",variant:"outline",className:"rounded-full",onClick:()=>o(!1),children:"Cancel"})]})]}):e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(d,{type:"button",size:"sm",className:"rounded-full",disabled:i,onClick:()=>
1c("accepted"),children:[e.jsx(k,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),"Accept"]}),e.jsxs(d,{type:"button",size:"sm",variant:"outline",className:"rounded-full border-red-300/70 text-red-700 hover:bg-red-50",disabled:i,onClick:()=>o(!0),children:[e.jsx(C,{className:"mr-1.5 h-3.5 w-3.5","aria-hidden":!0}),"Reject"]})]})}):null]})}function m({label:s,value:i}){return e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs uppercase tracking-wide text-bliss-ink-soft",children:s}),e.jsx("dd",{className:"text-bliss-ink",children:i??"—"})]})}export{T as component};

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.