1import{r as a,u as T,h as A,j as s,aO as E,aV as F,B as g,aQ as N,ao as y,ap as r,Y as b,aq as C}from"./index-fb3c7097.js";/* empty css */import{u as Y}from"./usePagination-526658a0.js";import{u as R}from"./getAllHelps-bee8b369.js";const _=()=>{const[i,w]=a.useState("");a.useState(!1);const[c,S]=a.useState(""),[u,m]=a.useState("user"),[o,k]=a.useState(10),h=T(),{page:l,changePage:d}=Y(),{data:t,isLoading:p,isFetching:x,refetch:f}=R({page:l,search:i,status:c,userType:u,rows:o}),j=e=>{k(e),d(1)},[n,P]=a.useState("adventure-seeker");a.useEffect(()=>{f()},[l,c,u]),a.useEffect(()=>{const e=setTimeout(()=>{f()},500);return()=>clearTimeout(e)},[i]);const[M,$]=A(),v=e=>{P(e),$({tab:e}),e==="activity-owner"?m("owner"):e==="adventure-seeker"&&m("user")};return s.jsx(s.Fragment,{children:s.jsxs(E,{title:"Help and Support",children:[s.jsx("div",{className:"row",children:s.jsx("div",{className:"col-md-6",children:s.jsx("h3",{className:"semi-bold f-32 text-white ",children:"Help & Support"})})}),s.jsxs("div",{className:"row my-4 search-bar search-user-icon user-top-search align-items-end",children:[s.jsx("div",{className:"col-md-4",children:s.jsxs("div",{className:"search-user-icon relative w-100",children:[s.jsx("input",{type:"text",className:"form-control",placeholder:"Search",value:i,onChange:e=>w(e.target.value)}),s.jsx("i",{className:"fa-solid fa-magnifying-glass"})]})}),s.jsx("div",{className:"col-md-3 filters-fields",children:s.jsx("div",{className:"select-field-wrapper",children:s.jsx("select",{name:"location",className:"form-select",onChange:e=>S(e.target.value),value:c,children:F.map(({label:e,value:D})=>s.jsx("option",{value:D,children:e},e==null?void 0:e.toString()))})})})]}),s.jsxs("div",{className:"user-tabs-filter pt-3",children:[s.jsxs("div",{className:"tab-buttons d-flex align-items-center gap-3",children:[s.jsx(g,{type:"button",className:`rounded-full bg-transparent border ${n==="adventure-seeker"?"active":""}`,variant:"primary",onClick:()=>v("adventure-seeker"),children:"Adventure Seeker"}),s.jsx(g,{type:"button",className:`rounded-full bg-transparent border ${n==="activity-owner"?"active":""}`,variant:"primary",onClick:()=>v("activity-owner"),children:"Activity Owner"})]}),s.jsxs("div",{className:"tabs-table",children:[n==="adventure-seeker"&&s.jsx(N,{isLoading:p,isFetching:x,children:s.jsx("div",{className:"user-tabs-filter pt-3",children:s.jsx("div",{className:"tabs-table",children:s.jsx("div",{className:"tablecard bg-black support-table rounded-full mt-3 p-3",children:s.jsx("div",{className:"row mt-0",children:s.jsx(y,{rowsPerPage:o,currentPage:l,onPageChange:d,onRowsPerPageChange:j,totalRows:t==null?void 0:t.count,data:(t==null?void 0:t.data)??[],columns:[{title:"Email",field:"userId",Cell({entry:{userId:e}}){return s.jsx("div",{className:"d-flex flex-column",children:s.jsx("span",{children:e==null?void 0:e.email})})}},{title:"Title",field:"title",Cell({entry:{title:e}}){return s.jsx("span",{children:`${r.upperFirst(e.slice(0,20))}${e.length>20?"..............":""}`})}},{title:"Query",field:"query",Cell({entry:{query:e}}){return s.jsx("span",{children:`${e.slice(0,50)}${e.length>50?"..............":""}`})}},{title:"Date",field:"createdAt",Cell({entry:{createdAt:e}}){return s.jsx("span",{className:"date-time",children:b(e).format("DD MMM YYYY")})}},{title:"Status",field:"status",Cell({entry:{status:e}}){return s.jsx("span",{className:"resolved-status",style:e==="resolved"?{color:"white",backgroundColor:"#2A5C02"}:{color:"white",backgroundColor:"#E2DB34"},children:r.upperFirst(e)})}},{title:"Action",field:"status",Cell({entry:e}){return s.jsx(s.Fragment,{children:s.jsx("div",{className:"table-btns",children:s.jsx(C,{fontSize:"medium",sx:{cursor:"pointer","&:hover":{fill:"#1976D2"}},onClick:()=>h(`/admin/support-query/${e._id}`)})})})}}]})})})})})}),n==="activity-owner"&&s.jsx(N,{isLoading:p,isFetching:x,children:s.jsx("div",{className:"user-tabs-filter pt-3",children:s.jsx("div",{className:"tabs-table",children:s.jsx("div",{className:"tablecard bg-black rounded-full mt-3",children:s.jsx("div",{className:"row mt-3",children:s.jsx(y,{rowsPerPage:o,currentPage:l,onPageChange:d,onRowsPerPageChange:j,totalRows:t==null?void 0:t.count,data:(t==null?void 0:t.data)??[],columns:[{title:"Name & Email",field:"userId",Cell({entry:{userId:e}}){return s.jsxs("div",{className:"d-flex flex-column",children:[s.jsx("span",{className:"gray semi-bold",children:r.upperFirst(e==null?void 0:e.name)}),s.jsx("span",{children:e==null?void 0:e.email})]})}},{title:"Title",field:"title",Cell({entry:{title:e}}){return s.jsx("span",{children:`${r.upperFirst(e.slice(0,20))}${e.length>20?"..............":""}`})}},{title:"Query",field:"query",Cell({entry:{query:e}}){return s.jsx("span",{children:`${e.slice(0,50)}${e.length>50?"..............":""}`})}},{title:"Date",field:"createdAt",Cell({entry:{createdAt:e}}){return s.jsx("span",{className:"date-time",children:b(e).format("DD MMM YYYY")})}},{title:"Status",field:"status",Cell({entry:{status:e}}){return s.jsx("span",{className:"resolved-status",style:e==="resolved"?{color:"white",backgroundColor:"#2A5C02"}:{color:"white",backgroundColor:"#E2DB34"},children:r.upperFirst(e)})}},{title:"Action",field:"status",Cell({entry:e}){return s.jsx(s.Fragment,{children:s.jsx("div",{className:"table-btns",children:s.jsx(C,{fontSize:"medium",sx:{cursor:"pointer","&:hover":{fill:"#1976D2"}},onClick:()=>h(`/admin/support-query/${e._id}`)})})})}}]})})})})})})]})]})]})})};export{_ as HelpSupport};
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.