PageSourceSearch

https://capitaldart.com/assets/support_._ticketId-CqbVhfTm.js

js capitaldart.com collected 2026-10-08 12:40:15 UTC 3,213 bytes, 2 lines download raw bytes

1import{a2 as N,J as v,K as c,r as k,M as w,q as S,t as o,j as e,L as u,B as T}from"./main-rwWalgtK.js";import{T as q}from"./textarea-BeBclvOl.js";import{B as m}from"./badge-WCCs5ZKg.js";import{g as F,r as L}from"./support.functions-BOC56kZB.js";function x(a){return new Date(a).toLocaleString()}function E(){const{ticketId:a}=N.useParams(),p=v(),h=c(F),b=c(L),[r,i]=k.useState(""),{data:d,isLoading:g,error:j}=w({queryKey:["support-thread",a],queryFn:()=>h({data:{ticketId:a}})}),n=S({mutationFn:()=>b({data:{ticketId:a,message:r.trim()}}),onSuccess:()=>{i(""),p.invalidateQueries({queryKey:["support-thread",a]}),o.success("Reply sent")},onError:s=>o.error(s instanceof Error?s.message:"Failed to send reply")});if(g)return e.jsx("div",{className:"mx-auto max-w-3xl px-4 py-8",children:"Loading…"});if(j||!d)return e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-8",children:[e.jsx("p",{className:"text-destructive",children:"Ticket not found."}),e.jsx(u,{to:"/support",className:"underline",children:"Back to support"})]});const{ticket:t,messages:y}=d,f=t.status==="resolved"||t.status==="closed";return e.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-8 sm:px-6",children:[e.jsx("div",{className:"mb-2",children:e.jsx(u,{to:"/support",className:"text-xs text-brand-muted underline",children:"← All tickets"})}),e.jsxs("div",{className:"mb-6 border-b border-brand-line pb-4",children:[e.jsx("h1",{className:"font-serif text-2xl text-brand-ink",children:t.subject}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-brand-muted",children:[t.category?e.jsx(m,{variant:"outline",className:"capitalize",children:t.category}):null,e.jsx(m,{variant:"outline",className:"capitalize",children:t.status.replace("_"," ")}),e.jsxs("span",{children:["Opened ",x(t.created_at)]})]})]}),e.jsx("ul",{className:"space-y-4",children:y.map(s=>{const l=s.author_role==="admin";return e.jsxs("li",{className:l?"rounded-lg border border-brand-accent/40 bg-brand-accent/10 p-4":"rounded-lg border border-brand-line bg-brand-paper p-4",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs text-brand-muted",children:[e.jsx("span",{className:"font-medium uppercase tracking-wider",children:l?"CapitalDart":"You"}),e.jsx("span",{children:x(s.created_at)})]}),e.jsx("div",{className:"whitespace-pre-wrap text-[14px] text-brand-ink",children:s.body})]},s.id)})}),f?e.jsxs("div",{className:"mt-6 rounded-lg border border-brand-line bg-brand-paper-2 p-4 text-sm text-brand-muted",children:["This ticket is ",t.status,". Open a new one if you have additional questions."]}):e.jsxs("form",{onSubmit:s=>{s.preventDefault(),r.trim().length>0&&!n.isPending&&n.mutate()},className:"mt-6 space-y-3",children:[e.jsx("label",{className:"block text-xs font-medium uppercase tracking-wider text-brand-muted",children:"Reply"}),e.jsx(q,{value:r,onChange:s=>i(s.target.value),rows:5,maxLength:1e4,placeholder:"Add to this ticket…"}),e.jsx("div",{className:"flex justify-end",children:e.jsx(T,{type:"submit",disabled:r.trim().length===0||n.isPending,children:n.isPending?"Sending…":"Send reply"})})]})]})}export{E as component};
2//# sourceMappingURL=support_._ticketId-CqbVhfTm.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.