PageSourceSearch

https://resolveit.ai/assets/therapist-detail-UJr63_C-.js

js resolveit.ai collected 2026-10-05 15:16:43 UTC 8,293 bytes, 1 lines download raw bytes

1import{aZ as C,s as P,l as k,v as x,j as e,L as T,e as $,B as j,N as U,C as d,w as n,x as l,ad as E,a as c,g as F,F as L,ag as g,ah as v,ai as N,aj as b,al as i,cb as y,a6 as q,cc as A,av as S,S as B,a2 as p,W as u}from"./pages-admin-CBNFTGIo.js";import{f as M}from"./phone-CWLuOqrh.js";function K(){const[,m]=C("/admin/therapist/therapists/:id"),a=m?.id?parseInt(m.id,10):0,{toast:r}=P(),{data:s,isLoading:w}=k({queryKey:["/api/therapist-admin/therapists",a],queryFn:async()=>{const t=await fetch(`/api/therapist-admin/therapists/${a}`,{credentials:"include"});if(!t.ok)throw new Error("Failed to load therapist");return t.json()},enabled:a>0}),h=x({mutationFn:async t=>{await u("PUT",`/api/therapist-admin/therapists/${a}/directory-status`,{directoryStatus:t})},onSuccess:()=>{p.invalidateQueries({queryKey:["/api/therapist-admin/therapists",a]}),r({title:"Directory status updated"})},onError:t=>{r({title:"Failed",description:t.message,variant:"destructive"})}}),f=x({mutationFn:async t=>{await u("PUT",`/api/therapist-admin/therapists/${a}/verification-status`,{verificationStatus:t})},onSuccess:()=>{p.invalidateQueries({queryKey:["/api/therapist-admin/therapists",a]}),r({title:"Verification status updated"})},onError:t=>{r({title:"Failed",description:t.message,variant:"destructive"})}}),o=x({mutationFn:async()=>{await u("POST",`/api/therapist-admin/therapists/${a}/suspend`,{})},onSuccess:()=>{p.invalidateQueries({queryKey:["/api/therapist-admin/therapists",a]}),r({title:"Therapist suspended"})},onError:t=>{r({title:"Failed",description:t.message,variant:"destructive"})}});return w||!s?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(T,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs("div",{"data-testid":"admin-therapist-detail",children:[e.jsx($,{href:"/admin/therapist/therapists",children:e.jsxs(j,{variant:"ghost",size:"sm",className:"mb-4","data-testid":"button-back-to-therapists",children:[e.jsx(U,{className:"h-4 w-4 mr-1"})," Back to Therapists"]})}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold","data-testid":"text-therapist-name",children:s.user?`${s.user.firstName} ${s.user.lastName}`:`User #${s.profile.userId}`}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.user?.email})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${s.profile.verificationStatus==="verified"?"bg-green-100 text-green-700":s.profile.verificationStatus==="suspended"?"bg-red-100 text-red-700":"bg-amber-100 text-amber-700"}`,children:s.profile.verificationStatus}),e.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${s.profile.directoryStatus==="listed"?"bg-blue-100 text-blue-700":s.profile.directoryStatus==="suspended"?"bg-red-100 text-red-700":"bg-gray-100 text-gray-600"}`,children:s.profile.directoryStatus})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(d,{children:[e.jsx(n,{children:e.jsxs(l,{className:"text-base flex items-center gap-2",children:[e.jsx(E,{className:"h-4 w-4"})," Profile"]})}),e.jsxs(c,{className:"space-y-2 text-sm",children:[s.profile.headshotUrl&&e.jsx("div",{className:"flex justify-center mb-3","data-testid":"admin-headshot-preview",children:e.jsx("img",{src:s.profile.headshotUrl,alt:"Therapist headshot",className:"h-24 w-24 rounded-full object-cover border border-gray-200","data-testid":"img-admin-headshot"})}),s.profile.practiceName&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Practice:"})," ",s.profile.practiceName]}),s.profile.yearsExperience!=null&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Experience:"})," ",s.profile.yearsExperience," years"]}),s.profile.bio&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground block",children:"Bio:"}),e.jsx("p",{children:s.profile.bio})]}),s.profile.phone&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Phone:"})," ",M(s.profile.phone)]}),s.profile.websiteUrl&&e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Website:"})," ",e.jsx("a",{href:s.profile.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:s.profile.websiteUrl})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Availability:"}
1)," ",s.profile.availabilityStatus.replace(/_/g," ")]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Max Cases:"})," ",s.profile.maxActiveCases]})]})]}),e.jsxs(d,{children:[e.jsx(n,{children:e.jsxs(l,{className:"text-base flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4"})," Admin Controls"]})}),e.jsxs(c,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"text-sm font-medium text-muted-foreground mb-1 block flex items-center gap-1",children:[e.jsx(L,{className:"h-3.5 w-3.5"})," Directory Status"]}),e.jsxs(g,{value:s.profile.directoryStatus,onValueChange:t=>h.mutate(t),disabled:h.isPending,"data-testid":"select-directory-status",children:[e.jsx(v,{children:e.jsx(N,{})}),e.jsxs(b,{children:[e.jsx(i,{value:"hidden",children:"Hidden"}),e.jsx(i,{value:"pending_approval",children:"Pending Approval"}),e.jsx(i,{value:"listed",children:"Listed"}),e.jsx(i,{value:"suspended",children:"Suspended"})]})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"text-sm font-medium text-muted-foreground mb-1 block flex items-center gap-1",children:[e.jsx(y,{className:"h-3.5 w-3.5"})," Verification Status"]}),e.jsxs(g,{value:s.profile.verificationStatus,onValueChange:t=>f.mutate(t),disabled:f.isPending,"data-testid":"select-verification-status",children:[e.jsx(v,{children:e.jsx(N,{})}),e.jsxs(b,{children:[e.jsx(i,{value:"unverified",children:"Unverified"}),e.jsx(i,{value:"pending",children:"Pending"}),e.jsx(i,{value:"verified",children:"Verified"}),e.jsx(i,{value:"suspended",children:"Suspended"})]})]})]}),s.profile.verificationStatus!=="suspended"&&e.jsxs(j,{variant:"destructive",size:"sm",onClick:()=>o.mutate(),disabled:o.isPending,"data-testid":"button-suspend",children:[e.jsx(q,{className:"h-4 w-4 mr-1"}),o.isPending?"Suspending...":"Suspend Account"]})]})]}),e.jsxs(d,{children:[e.jsx(n,{children:e.jsxs(l,{className:"text-base flex items-center gap-2",children:[e.jsx(y,{className:"h-4 w-4"})," Credentials (",s.credentials.length,")"]})}),e.jsx(c,{className:"space-y-2",children:s.credentials.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No credentials"}):s.credentials.map(t=>e.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg","data-testid":`credential-${t.id}`,children:[e.jsx("p",{className:"text-sm font-medium",children:t.credentialType}),t.licenseNumber&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["License: ",t.licenseNumber]}),t.issuingState&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["State: ",t.issuingState]}),e.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full mt-1 inline-block ${t.verificationStatus==="verified"?"bg-green-100 text-green-700":t.verificationStatus==="pending"?"bg-amber-100 text-amber-700":"bg-gray-100 text-gray-600"}`,children:t.verificationStatus})]},t.id))})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(d,{children:[e.jsx(n,{children:e.jsxs(l,{className:"text-base flex items-center gap-2",children:[e.jsx(A,{className:"h-4 w-4"})," Licensed States"]})}),e.jsx(c,{children:s.states.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No states"}):e.jsx("div",{className:"flex flex-wrap gap-1",children:s.states.map(t=>e.jsx(S,{variant:"secondary",className:"text-xs",children:t},t))})})]}),e.jsxs(d,{children:[e.jsx(n,{children:e.jsxs(l,{className:"text-base flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4"})," Specialties"]})}),e.jsx(c,{children:s.specialties.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No specialties"}):e.jsx("div",{className:"flex flex-wrap gap-1",children:s.specialties.map(t=>e.jsx(S,{variant:"outline",className:"text-xs",children:t.label},t.id))})})]})]})]})]})}export{K as default};

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.