Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/ondemand.codeskitter.site/build/static/js/
Upload File :
Current File : /home/users/unlimited/www/ondemand.codeskitter.site/build/static/js/781.f0b7eda7.chunk.js

"use strict";(self.webpackChunkproject=self.webpackChunkproject||[]).push([[781],{48781:(e,t,o)=>{o.r(t),o.d(t,{default:()=>S});var s=o(26240),a=o(96446),r=o(19252),n=o(22698),i=o(85865),l=o(68903),c=o(88911),d=o(59135),x=o(65043),h=o(72653),m=o(41503),p=o(84289),g=o(60498),b=o(25581),u=o(44978),j=o(17428),f=o(73216),y=o(69369),A=o(54669),k=o(24056),v=o(35475),w=o(70579);const N=()=>{var e,t;const[o,s]=(0,x.useState)(0),r=(0,f.zy)();const n={background:null===(e=(0,y.u)().palette)||void 0===e||null===(t=e.primary)||void 0===t?void 0:t.main,borderRadius:"6px",color:"white"};return(0,x.useEffect)((()=>{switch(r.pathname){case"/profile/booking":default:s(0);break;case"/profile/booking/awaiting":s(1);break;case"/profile/booking/confirmed":s(2);break;case"/profile/booking/cancelled":s(3);break;case"/profile/booking/rescheduled":s(4);break;case"/profile/booking/completed":s(5);break;case"/profile/booking/started":s(6)}const e=document.getElementsByClassName("MuiTabs-flexContainer");for(let t=0;t<e.length;t++)e[t].classList.add("css-heg063-MuiTabs-flexContainer")}),[r]),(0,w.jsx)("div",{children:(0,w.jsx)(a.A,{display:"flex",color:"black",bgcolor:"#F2F1F6",borderRadius:2,overflow:"auto",children:(0,w.jsxs)(A.A,{className:"tabs",sx:{opacity:1,overflow:"auto",color:"black",width:"100%"},textColor:"secondary",indicatorColor:"secondary",variant:"fullWidth",children:[(0,w.jsx)(v.N_,{to:"/profile/booking",children:(0,w.jsx)(k.A,{value:0,label:(0,u.t)("all"),sx:{opacity:1,color:"gray",textTransform:"none",minWidth:"145px"},style:0===o?n:{}})}),(0,w.jsx)(v.N_,{to:"/profile/booking/awaiting",children:(0,w.jsx)(k.A,{value:1,label:(0,u.t)("awaiting"),sx:{opacity:1,color:"gray",textTransform:"none",minWidth:"145px"},style:1===o?n:{}})}),(0,w.jsx)(v.N_,{to:"/profile/booking/confirmed",children:(0,w.jsx)(k.A,{value:2,label:(0,u.t)("confirmed"),sx:{color:"gray",opacity:1,textTransform:"none",minWidth:"145px"},style:2===o?n:{}})}),(0,w.jsx)(v.N_,{to:"/profile/booking/started",children:(0,w.jsx)(k.A,{value:6,label:(0,u.t)("started"),sx:{color:"gray",opacity:1,textTransform:"none",minWidth:"145px"},style:6===o?n:{}})}),(0,w.jsx)(v.N_,{to:"/profile/booking/cancelled",children:(0,w.jsx)(k.A,{value:3,label:(0,u.t)("cancelled"),sx:{color:"gray",opacity:1,textTransform:"none",minWidth:"145px"},style:3===o?n:{}})}),(0,w.jsx)(v.N_,{to:"/profile/booking/rescheduled",children:(0,w.jsx)(k.A,{value:4,label:(0,u.t)("rescheduled"),sx:{color:"gray",opacity:1,textTransform:"none",minWidth:"145px"},style:4===o?n:{}})}),(0,w.jsx)(v.N_,{to:"/profile/booking/completed",children:(0,w.jsx)(k.A,{value:5,label:(0,u.t)("completed"),sx:{color:"gray",opacity:1,textTransform:"none",minWidth:"145px"},style:5===o?n:{}})})]})})})};var C=o(36171),W=o(7416),T=o(70549),_=o(79456),F=o(58644);const S=()=>{const e=(0,_.wA)();document.title="Profile - Bookings | HausMate";const[t,o]=(0,x.useState)(!1),[y,A]=(0,x.useState)([]),[k,v]=(0,x.useState)(0),[S,B]=(0,x.useState)(),[M,P]=(0,x.useState)(),{status:U}=(0,f.g)();(0,x.useEffect)((()=>{(async()=>{o(!1);try{const t=await C.A.getOrders({id:"",currentPage:k,itemsPerPage:5,status:U,order_statuses:b.tW});e((0,T.FN)(t.data)),A(t.data),B(t.total),P(t.error)}catch(M){console.log("error",M)}finally{o(!0)}})()}),[k,e,U]);const E=(0,s.A)(),H=Math.ceil(S/5);return(0,w.jsxs)(p.A,{children:[(0,w.jsx)(a.A,{paddingTop:"35px",paddingBottom:"35px",mt:2,children:(0,w.jsxs)(r.A,{maxWidth:"lg",className:"mainContainer",children:[(0,w.jsxs)(n.A,{separator:"|","aria-label":"breadcrumb",className:"mb-1 mt-1",children:[(0,w.jsx)(W.w1,{to:"/",className:"breadcrumb",sx:{mb:0},children:(0,w.jsxs)("strong",{children:[" ",(0,u.t)("home")]})}),(0,w.jsx)(i.A,{color:"text.primary",children:(0,w.jsx)("strong",{children:(0,u.t)("profile")})})]}),(0,w.jsx)(i.A,{variant:"h4",gutterBottom:!0,sx:{mt:"12px"},children:(0,w.jsx)("strong",{children:(0,u.t)("bookings")})})]})}),(0,w.jsx)(r.A,{className:"mainContainer",sx:{mb:"30px",mt:"-50px"},children:(0,w.jsxs)(l.Ay,{spacing:3,container:!0,children:[(0,w.jsx)(l.Ay,{item:!0,xs:12,md:4,children:(0,w.jsx)(m.A,{})}),(0,w.jsx)(l.Ay,{item:!0,xs:12,md:8,children:(0,w.jsxs)(a.A,{sx:{background:E.palette.background.box},mt:3,minHeight:570,borderRadius:4,children:[(0,w.jsx)(h.A,{heading:(0,u.t)("my_bookings")}),(0,w.jsxs)(a.A,{padding:2,children:[(0,w.jsx)(a.A,{sx:{mb:3,overflow:"auto"},children:(0,w.jsx)(N,{})}),(0,w.jsx)(w.Fragment,{children:t?y&&(null===y||void 0===y?void 0:y.length)>0?(0,w.jsx)(g.A,{booking:y,status:"all"}):(0,w.jsx)(a.A,{display:"flex",justifyContent:"center",m:2,children:(0,w.jsxs)(a.A,{display:"block",textAlign:"center",width:"100%",height:"425px",children:[(0,w.jsx)(a.A,{src:F,alt:"No Booking Found",sx:{maxHeight:"100%",maxWidth:"100%"},component:"img"}),(0,w.jsx)(i.A,{children:(0,u.t)("no_booking")})]})}):(0,w.jsxs)(a.A,{children:[(0,w.jsx)(j.bU,{}),(0,w.jsx)(j.bU,{}),(0,w.jsx)(j.bU,{}),(0,w.jsx)(j.bU,{})]})}),(0,w.jsx)(a.A,{display:"flex",justifyContent:"center",mt:2,children:!1===M&&(0,w.jsx)(c.A,{spacing:2,children:(0,w.jsx)(d.A,{count:H,page:k+1,onChange:(e,t)=>v(t-1)})})})]})]})})]})})]})}}}]);
//# sourceMappingURL=781.f0b7eda7.chunk.js.map