import{d as x,i as h,q as g,H as I,J as _,o as e,j as s,c as S,w,b as n,aR as C,x as $,F as i,f as r,t as d,e as o,a as q,k as b,r as D}from"./index.29cf2edd.js";/* empty css              *//* empty css              *//* empty css              *//* empty css              *//* empty css              */import{_ as V}from"./Status.120e28ab.js";import{l as v,H as B}from"./index.26abd2fe.js";import{f as p}from"./filters.69c883c5.js";/* empty css              */const H=["href"],L={key:5},N=["onClick"],Q=x({__name:"Sos",setup(T){const k=v(`${C()}`);k.on("connect",()=>{console.log("Socket connected")}),k.on("disconnect",()=>{console.error("Socket disconnected")});const u=[{title:"Ticket ID",dataIndex:"ticket_id",key:"ticket_id"},{title:"Requester",dataIndex:"requester",key:"requester"},{title:"Message",dataIndex:"description",key:"description"},{title:"Location",dataIndex:"location",key:"location"},{title:"Distance",dataIndex:"distance",key:"distance"},{title:"Requested Date",dataIndex:"create_at",key:"create_at"},{title:"Status",dataIndex:"status",key:"status"},{title:"Acceptor",dataIndex:"acceptor",key:"acceptor"},{title:"Actions",dataIndex:"actions",key:"actions"}];let l=h();g(async()=>{await m()});const m=async()=>{I(),B.getSosTickets().then(c=>{_(),l.value=c.data}).catch(c=>{_()})};return(c,A)=>{const y=V,f=$;return e(),s("div",null,[S(f,{columns:u,"data-source":n(l)},{bodyCell:w(({column:a,text:R,record:t})=>[a.key==="requester"?(e(),s(i,{key:0},[r(d(`${t.firstname} ${t.lastname}`),1)],64)):o("",!0),a.key==="location"?(e(),s("a",{key:1,href:`https://www.google.com/maps/@${t.lat},${t.lng}`,target:"_blank"},"Location",8,H)):o("",!0),a.key==="distance"?(e(),s(i,{key:2},[r(d(n(p).formatAmount(t.acc)),1)],64)):o("",!0),a.key==="create_at"?(e(),s(i,{key:3},[r(d(n(p).formatDate(t.create_at)),1)],64)):o("",!0),a.key==="status"?(e(),q(y,{key:4,status:t.status},null,8,["status"])):o("",!0),a.key==="actions"?(e(),s("span",L,[b("a",{onClick:F=>n(D).push("/help-center/sos/ticket/"+t.ticket_id)},"View",8,N)])):o("",!0)]),_:1},8,["data-source"])])}}});export{Q as default};
