PageSourceSearch

https://www.internships.com/assets/ops.concierge._messageRef-iHLePiMW.js

js internships.com collected 2026-09-24 18:27:16 UTC 5,175 bytes, 1 lines download raw bytes

1import{j as e,c as x,a as u,b as h,r as c,aK as y,dJ as w,gC as v,L as F}from"./main-DmDsGTCr.js";import{u as E}from"./use-ops-reply-channel-NrWi_W0W.js";import{u as S}from"./useMutation-BXaTcy4a.js";import"./use-feature-flag-C9iVprKR.js";function C({detail:s}){return e.jsxs("article",{className:"rounded border border-border p-4",children:[e.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-sm",children:[e.jsx("dt",{className:"font-medium text-text-muted",children:"From"}),e.jsx("dd",{className:"text-text",children:s.from}),e.jsx("dt",{className:"font-medium text-text-muted",children:"Subject"}),e.jsx("dd",{className:"text-text",children:s.subject?.trim()||"(no subject)"}),e.jsx("dt",{className:"font-medium text-text-muted",children:"Received"}),e.jsx("dd",{className:"text-text",children:new Date(s.receivedAt).toLocaleString()})]}),e.jsx("hr",{className:"my-4 border-border"}),s.hasBody?e.jsx("pre",{className:"whitespace-pre-wrap font-sans text-sm text-text",children:s.textBody}):e.jsx("p",{className:"text-sm text-text-muted italic",children:"No body available for this message."})]})}const k=x({method:"GET"}).middleware([u]).handler(h("88380971cd0d4331bea79f317b666c64fc0017e4a2ab601bdcffd97be216b43c")),T=x({method:"GET"}).middleware([u]).handler(h("ae2def0e38e30ecaeba57aa6570fe8217b02fdf7d6e6aee4bb379c9e97af7fd0")),I=x({method:"POST"}).middleware([u]).handler(h("a24f0397c9c1432fdbb7a2d67895007cdad3f2b62e63d4df90fe256f0f1fdc2d")),N=2;function D({messageRef:s}){const[n,r]=c.useState(""),[l,i]=c.useState(""),[d,p]=c.useState(null),f=c.useId();c.useEffect(()=>{const t=setTimeout(()=>i(n.trim()),200);return()=>clearTimeout(t)},[n]);const o=y({queryKey:["ops","concierge-student-search",l],queryFn:()=>T({data:{query:l}}),enabled:l.length>=N}),m=o.data?.ok?o.data.students:[],a=S({mutationFn:t=>I({data:{messageRef:s,recipientUserId:t}}),onSuccess:t=>{t.ok&&p(null)}}),b=a.isError?"SEND_FAILED":a.data&&!a.data.ok?a.data.error.code:void 0,g=a.data?.ok?a.data.sentTo:null;return e.jsxs("div",{className:"rounded border border-border p-4",children:[e.jsx("h2",{className:"font-bold text-sm text-text",children:"Forward to a student"}),e.jsx("p",{className:"mt-1 text-text-muted text-xs",children:"Search for the student this message is really for. It is sent to their on-file email."}),e.jsx("input",{type:"search",value:n,onChange:t=>r(t.target.value),placeholder:"Search students by name or email","aria-label":"Search students by name or email","aria-controls":f,className:"mt-3 w-full rounded border border-border px-3 py-2 text-sm"}),o.isFetching?e.jsx("p",{className:"mt-2 text-text-muted text-xs",children:"Searching…"}):null,o.isError?e.jsx("p",{role:"alert",className:"mt-2 text-danger text-xs",children:"Couldn't search students. Try again."}):null,m.length>0?e.jsx("ul",{id:f,className:"mt-2 divide-y divide-border/60",children:m.map(t=>{const j=d?.userId===t.userId;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>p(t),"aria-pressed":j,className:`flex w-full flex-col items-start px-2 py-2 text-left text-sm ${j?"bg-purple/10":"hover:bg-surface-muted"}`,children:[e.jsx("span",{className:"font-medium text-text",children:t.name?.trim()||t.email}),e.jsx("span",{className:"text-text-muted text-xs",children:t.email})]})},t.userId)})}):null,l.length>=N&&!o.isFetching&&!o.isError&&m.length===0?e.jsx("p",{className:"mt-2 text-text-muted text-xs",children:"No students found."}):null,e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsx("button",{type:"button",disabled:!d||a.isPending,onClick:()=>d&&a.mutate(d.userId),className:"rounded-full bg-purple px-4 py-1.5 font-bold text-white text-xs disabled:opacity-50",children:a.isPending?"Forwarding…":"Forward"}),d?e.jsxs("span",{className:"text-text-muted text-xs",children:["to ",d.name?.trim()||d.email]}):null]}),g?e.jsxs("p",{className:"mt-3 text-sm text-success",children:["Forwarded to ",g,"."]}):null,b?e.jsxs("p",{role:"alert",className:"mt-3 text-danger text-sm",children:["Couldn't forward the message (",b,"). Please try again."]}):null]})}function q(s){return w({queryKey:["ops","concierge-detail",s],queryFn:()=>k({data:{messageRef:s}})})}function L(){return e.jsx(F,{to:"/ops/apply",className:"mb-4 inline-block text-purple text-sm hover:underline",children:"← Back to queue"})}function P(){const{messageRef:s}=v.useParams(),n=E(),{data:r,isLoading:l,isError:i}=y({...q(s),enabled:n});return n?e.jsxs("div",{className:"mx-auto w-full max-w-3xl px-6 py-8",children:[e.jsx(L,{}),l?e.jsx("p",{className:"text-sm text-text-muted",children:"Loading…"}
1):i?e.jsx("p",{role:"alert",className:"text-sm text-danger",children:"Couldn’t load this message. Try again."}):r?.ok?e.jsxs("div",{className:"space-y-6",children:[e.jsx(C,{detail:r.detail}),e.jsx(D,{messageRef:s})]}):e.jsx("p",{className:"text-sm text-danger",children:r&&"error"in r&&r.error.code==="FORBIDDEN"?"You don’t have access to this message.":"Message not found."})]}):e.jsx("div",{className:"mx-auto w-full max-w-3xl px-6 py-8",children:e.jsx("p",{className:"text-sm text-text-muted",children:"This page isn’t available."})})}export{P 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.