PageSourceSearch

https://bacctrack-7ha7hyw7.manus.space/assets/SupportPage-BzPrOy7v.js

js bacctrack-7ha7hyw7.manus.space collected 2026-10-03 05:00:50 UTC 10,852 bytes, 1 lines download raw bytes

1import{a as M,t as u,r as p,b as m,j as e}from"./index-C3Qps0S4.js";import{C as N,a as v}from"./card-DtXeaqs_.js";import{B as i}from"./button-xdpkFraK.js";import{B}from"./badge-DBCec9J8.js";import{I as f}from"./input-Dj8udylZ.js";import{T as _}from"./textarea-DrSHHi7w.js";import{S as z,a as y,b as w,c as C,d as t}from"./select-C8zBw1Za.js";import{S as E}from"./skeleton-Dte_fR4v.js";import{D as H,a as L,b as V,c as R,d as q}from"./dialog-BY1FISUw.js";import{T,M as F}from"./ticket-B5N_1x6y.js";import{P as K}from"./plus-BLlLQSZn.js";import{C as O}from"./clock-CHw5d3NP.js";import{S as Q}from"./send-CbRcUDpe.js";import"./index-Jol-UBUv.js";import"./index-BdQq_4o_.js";import"./index-Dr02_Kwf.js";import"./index-BBBp6CNx.js";import"./chevron-up-F-ZIdiqt.js";import"./index-BKUanX19.js";const D={new:{label:"รอตรวจสอบ",color:"bg-blue-500/20 text-blue-400"},in_progress:{label:"กำลังดำเนินการ",color:"bg-yellow-500/20 text-yellow-400"},waiting_user:{label:"รอคุณตอบ",color:"bg-purple-500/20 text-purple-400"},resolved:{label:"แก้ไขแล้ว",color:"bg-green-500/20 text-green-400"},closed:{label:"ปิดแล้ว",color:"bg-zinc-500/20 text-zinc-400"}};function ge(){const{user:S}=M(),{data:n,isLoading:A,refetch:h}=u.tickets.myTickets.useQuery(void 0,{enabled:!!S}),g=u.tickets.create.useMutation({onSuccess:()=>{h(),j(!1),m.success("ส่งตั๋วสำเร็จ")}}),d=u.tickets.reply.useMutation({onSuccess:()=>{h(),b(""),P(null),m.success("ส่งข้อความสำเร็จ")}}),[k,j]=p.useState(!1),[x,P]=p.useState(null),[r,b]=p.useState(""),[a,l]=p.useState({subject:"",category:"general",message:"",priority:"medium"});return S?e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:49",className:"space-y-6 max-w-2xl mx-auto",children:[e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:50",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:51",children:[e.jsxs("h1",{"data-loc":"client/src/pages/SupportPage.tsx:52",className:"text-2xl font-bold text-orange-400 flex items-center gap-2",children:[e.jsx(T,{"data-loc":"client/src/pages/SupportPage.tsx:53",className:"w-6 h-6"})," ศูนย์ช่วยเหลือ"]}),e.jsx("p",{"data-loc":"client/src/pages/SupportPage.tsx:55",className:"text-sm text-zinc-500 mt-1",children:"ส่งคำร้องหรือแจ้งปัญหา"})]}),e.jsxs(H,{"data-loc":"client/src/pages/SupportPage.tsx:57",open:k,onOpenChange:j,children:[e.jsx(L,{"data-loc":"client/src/pages/SupportPage.tsx:58",asChild:!0,children:e.jsxs(i,{"data-loc":"client/src/pages/SupportPage.tsx:59",className:"bg-orange-500 hover:bg-orange-600",children:[e.jsx(K,{"data-loc":"client/src/pages/SupportPage.tsx:60",className:"w-4 h-4 mr-1"})," สร้างตั๋วใหม่"]})}),e.jsxs(V,{"data-loc":"client/src/pages/SupportPage.tsx:63",className:"bg-zinc-900 border-zinc-800",children:[e.jsx(R,{"data-loc":"client/src/pages/SupportPage.tsx:64",children:e.jsx(q,{"data-loc":"client/src/pages/SupportPage.tsx:65",className:"text-orange-400",children:"สร้างตั๋วซัพพอร์ต"})}),e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:67",className:"space-y-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:68",children:[e.jsx("label",{"data-loc":"client/src/pages/SupportPage.tsx:69",className:"text-sm text-zinc-400",children:"หัวข้อ"}),e.jsx(f,{"data-loc":"client/src/pages/SupportPage.tsx:70",value:a.subject,onChange:s=>l({...a,subject:s.target.value}),placeholder:"เช่น Point ไม่เข้า",className:"bg-zinc-800 border-zinc-700"})]}),e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:77",className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:78",children:[e.jsx("label",{"data-loc":"client/src/pages/SupportPage.tsx:79",className:"text-sm text-zinc-400",children:"หมวดหมู่"}),e.jsxs(z,{"data-loc":"client/src/pages/SupportPage.tsx:80",value:a.category,onValueChange:s=>l({...a,category:s}),children:[e.jsx(y,{"data-loc":"client/src/pages/SupportPage.tsx:81",className:"bg-zinc-800 border-zinc-700",children:e.jsx(w,{"data-loc":"client/src/pages/SupportPage.tsx:82"})}),e.jsxs(C,{"data-loc":"client/src/pages/SupportPage.tsx:84",children:[e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:85",value:"general",children:"ทั่วไป"}),e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:86",value:"credit",children:"Point"}),e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:87",value:"formula",children:"สูตร"}),e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:88",value:"account",children:"บัญชี"}),e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:89",value:"bug",children:"แจ้งบัก"})]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:93",children:[e.jsx("label",{"data-loc":"client/src/pages/SupportPage.tsx:94",className:"text-sm text-zinc-400",children:"ความเร่งด่วน"}),e.jsxs(z,{"data-loc":"client/src/pages/SupportPage.tsx:95",value:a.priority,onValueChange:s=>l({...a,priority:s}),children:[e.jsx(y,{"data-loc":"client/src/pages/SupportPage.tsx:96",className:"bg-zinc-800 border-zinc-700",children:e.jsx(w,{"data-loc":"client/src/pages/SupportPage.tsx:97"})}),e.jsxs(C,{"data-loc":"client/src/pages/SupportPage.tsx:99",children:[e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:100",value:"low",children:"ต่ำ"}),e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:101",value:"medium",children:"ปานกลาง"}),e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:102",value:"high",children:"สูง"}),e.jsx(t,{"data-loc":"client/src/pages/SupportPage.tsx:103",value:"urgent",children:"เร่งด่วน"})]})]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:108",children:[e.jsx("label",{"data-loc":"client/src/pages/SupportPage.tsx:109",className:"text-sm text-zinc-400",children:"รายละเอียด"}),e.jsx(_,{"data-loc":"client/src/pages/SupportPage.tsx:110",value:a.message,onChange:s=>l({...a,message:s.target.value}),placeholder:"อธิบายปัญหาหรือคำร้องของคุณ...",className:"bg-zinc-800 border-zinc-700 min-h-[100px]"})]}),e.jsx(i,{"data-loc":"client/src/pages/SupportPage.tsx:117",onClick:()=>
1{if(!a.subject.trim()||!a.message.trim()){m.error("กรุณากรอกข้อมูลให้ครบ");return}g.mutate({subject:a.subject,category:a.category,message:a.message,priority:a.priority})},disabled:g.isPending,className:"w-full bg-orange-500 hover:bg-orange-600",children:g.isPending?"กำลังส่ง...":"ส่งตั๋ว"})]})]})]})]}),A?e.jsx("div",{"data-loc":"client/src/pages/SupportPage.tsx:139",className:"space-y-3",children:Array.from({length:3}).map((s,o)=>e.jsx(E,{"data-loc":"client/src/pages/SupportPage.tsx:140",className:"h-20"},o))}):e.jsx("div",{"data-loc":"client/src/pages/SupportPage.tsx:143",className:"space-y-3",children:!n||n.length===0?e.jsx(N,{"data-loc":"client/src/pages/SupportPage.tsx:145",className:"bg-zinc-900/50 border-zinc-800",children:e.jsx(v,{"data-loc":"client/src/pages/SupportPage.tsx:146",className:"py-8 text-center text-zinc-500",children:'ยังไม่มีตั๋ว กดปุ่ม "สร้างตั๋วใหม่" เพื่อส่งคำร้อง'})}):n.map(s=>{const o=D[s.status]||D.new;return e.jsx(N,{"data-loc":"client/src/pages/SupportPage.tsx:154",className:"bg-zinc-900/50 border-zinc-800",children:e.jsxs(v,{"data-loc":"client/src/pages/SupportPage.tsx:155",className:"p-4",children:[e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:156",className:"flex items-start justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:157",children:[e.jsx("p",{"data-loc":"client/src/pages/SupportPage.tsx:158",className:"font-medium text-zinc-200",children:s.subject}),e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:159",className:"flex items-center gap-2 mt-1",children:[e.jsx(B,{"data-loc":"client/src/pages/SupportPage.tsx:160",className:o.color+" text-xs",children:o.label}),e.jsxs("span",{"data-loc":"client/src/pages/SupportPage.tsx:161",className:"text-xs text-zinc-500 flex items-center gap-1",children:[e.jsx(O,{"data-loc":"client/src/pages/SupportPage.tsx:162",className:"w-3 h-3"}),new Date(s.createdAt).toLocaleDateString("th-TH")]})]})]}),e.jsxs(i,{"data-loc":"client/src/pages/SupportPage.tsx:167",variant:"ghost",size:"sm",className:"text-orange-400 text-xs",onClick:()=>P(x===s.id?null:s.id),children:[e.jsx(F,{"data-loc":"client/src/pages/SupportPage.tsx:173",className:"w-3 h-3 mr-1"}),x===s.id?"ซ่อน":"ดู/ตอบ"]})]}),x===s.id&&e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:179",className:"mt-3 pt-3 border-t border-zinc-800 space-y-2",children:[s.messages&&s.messages.map((c,I)=>e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:181",className:`p-2 rounded text-sm ${c.senderType==="admin"?"bg-orange-500/10 border-l-2 border-orange-500":"bg-zinc-800"}`,children:[e.jsxs("span",{"data-loc":"client/src/pages/SupportPage.tsx:182",className:"text-xs text-zinc-500",children:[c.senderType==="admin"?"แอดมิน":"คุณ"," • ",new Date(c.createdAt).toLocaleString("th-TH")]}),e.jsx("p",{"data-loc":"client/src/pages/SupportPage.tsx:183",className:"text-zinc-300 mt-1",children:c.message})]},I)),s.status!=="closed"&&s.status!=="resolved"&&e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:187",className:"flex gap-2 mt-2",children:[e.jsx(f,{"data-loc":"client/src/pages/SupportPage.tsx:188",value:r,onChange:c=>b(c.target.value),placeholder:"พิมพ์ข้อความ...",className:"bg-zinc-800 border-zinc-700 text-sm",onKeyDown:c=>{c.key==="Enter"&&r.trim()&&d.mutate({ticketId:s.id,message:r})}}),e.jsx(i,{"data-loc":"client/src/pages/SupportPage.tsx:199",size:"sm",className:"bg-orange-500 hover:bg-orange-600",disabled:!r.trim()||d.isPending,onClick:()=>{r.trim()&&d.mutate({ticketId:s.id,message:r})},children:e.jsx(Q,{"data-loc":"client/src/pages/SupportPage.tsx:209",className:"w-4 h-4"})})]})]})]})},s.id)})})]}):e.jsxs("div",{"data-loc":"client/src/pages/SupportPage.tsx:41",className:"text-center py-12",children:[e.jsx(T,{"data-loc":"client/src/pages/SupportPage.tsx:42",className:"w-16 h-16 text-zinc-600 mx-auto mb-4"}),e.jsx("p",{"data-loc":"client/src/pages/SupportPage.tsx:43",className:"text-zinc-400",children:"กรุณาเข้าสู่ระบบเพื่อส่งตั๋วซัพพอร์ต"})]})}
1export{ge 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.