PageSourceSearch

https://regalflowers.com.ng/_next/static/chunks/pages/dashboard/orders-b3fb299d58a3c1b1.js

js regalflowers.com.ng collected 2026-09-29 15:36:01 UTC 5,191 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[954],{8700:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/orders",function(){return t(9211)}])},9211:function(e,r,t){"use strict";t.r(r),t.d(r,{__N_SSG:function(){return Y}});var s=t(7568),a=t(6042),n=t(9396),i=t(9534),o=t(253),l=t(9815),d=t(92),u=t(5893),c=t(7294),h=t(9008),f=t.n(h),v=t(1163),p=t(2563),y=t(3350),g=t(9268),_=t(2384),x=t(9791),m=t(9525),b=t(2159),N=t(3660),O=t(1170),w=t.n(O),j=t(5070),S=[{label:"Delivery Date",value:"deliveryDate-desc"},{label:"Status",value:"status-asc"}],Z=[{label:"All",value:""},{label:"Pending",value:"Pending"}].concat((0,l.Z)(m.Z_.map((function(e){return{label:e,value:e}})))),D={Delivered:{heading:"No Delivered Orders Yet",subtext:"You haven't received any orders yet. Once your orders are delivered, they will appear here."},"Delivery Failed":{heading:"No Delivery Failed Orders Yet",subtext:"You haven't had any failed deliveries yet. Once your orders fail to be delivered, they will appear here."},Despatched:{heading:"No Despatched Orders Yet",subtext:"You haven't had any despatched orders yet. Once your orders are despatched, they will appear here."},"Order Arranged":{heading:"No Arranged Orders Yet",subtext:"You haven't had any arranged orders yet. Once your orders are arranged, they will appear here."},"Order Received":{heading:"No Received Orders Yet",subtext:"You haven't had any received orders yet. Once your orders are received, they will appear here."}},Y=!0;r.default=function(e){var r,t,h=e.pageSections,O=(0,v.useRouter)(),Y=O.query.status,F="string"!==typeof Y||"Pending"!==Y&&!m.Z_.includes(Y)?"":Y,k=(0,c.useContext)(b.Z),E=k.notify,q=k.confirm,P=(0,c.useState)([]),R=P[0],A=P[1],B=(0,c.useState)(null),C=B[0],T=B[1],J=(0,c.useState)("deliveryDate-desc"),L=J[0],X=J[1],G=(0,c.useState)(!0),H=G[0],I=G[1],U=(0,c.useState)(!1),z=U[0],K=U[1],M=(0,c.useState)(null),Q=M[0],V=M[1],W=(0,o.Z)((0,j.Z)({node:Q}),2),$=W[0],ee=W[1],re=(0,c.useRef)({status:F,sort:L}),te=function(e){q({title:"Delete Order",body:"Are you sure you want to delete this order?",okText:"Delete",cancelText:"Cancel",onOk:(0,s.Z)((function(){var r;return(0,d.__generator)(this,(function(t){switch(t.label){case 0:return[4,(0,N.b6)(e.id)];case 1:return(r=t.sent()).error?(E("error",r.message||"Failed to delete order"),[2]):(se(),E("success","Order deleted successfully"),[2])}}))}))})},se=function(){var e=(0,s.Z)((function(e){var r,t,s,a;return(0,d.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,N.t9)({status:F,sortBy:L.split("-")[0],sortOrder:L.split("-")[1],cursor:e&&C||""})];case 1:return(r=n.sent()).error?E("error",r.message||"Failed to load orders"):r.data&&(t=r.data,s=t.orders,a=t.nextCursor,A((function(r){return e?(0,l.Z)(r).concat((0,l.Z)(s)):s})),T(a)),[2]}}))}));return function(r){return e.apply(this,arguments)}}();return(0,c.useEffect)((function(){if(O.isReady){if((re.current.status!==F||re.current.sort!==L)&&1!==$)return re.current={status:F,sort:L},void ee(1);re.current={status:F,sort:L},1===$?(I(!0),se().finally((function(){return I(!1)}))):(K(!0),se(!0).finally((function(){return K(!1)})))}}),[$,F,L]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(f(),{children:(0,u.jsx)("title",{children:"Orders | Regal Flowers"})}),(0,u.jsxs)(p.Z,{pageSections:h,children:[(0,u.jsxs)("div",{className:w().header,children:[(0,u.jsx)("span",{className:w().title,children:"Orders"}),(0,u.jsxs)("div",{className:w().filters,children:[(0,u.jsxs)("div",{className:"input-group ".concat(w().sort),children:[(0,u.jsx)("span",{className:"question",children:"Order Status: "}),(0,u.jsx)(x.Z,{options:Z,value:F,onSelect:function(e){var r=O.query,t=(r.status,(0,i.Z)(r,["status"])),s=String(e);O.push({pathname:O.pathname,query:s?(0,n.Z)((0,a.Z)({},t),{status:s}):t},void 0,{shallow:!0})},className:w().filter})]}),(0,u.jsxs)("div",{className:"input-group ".concat(w().sort),children:[(0,u.jsx)("span",{className:"question",children:"Sort By: "}),(0,u.jsx)(x.Z,{options:S,value:L,onSelect:function(e){return X(e)},placeholder:"Sort By",className:w().filter})]})]})]}),H?(0,u.jsx)(g.Z,{}):0===R.length?(0,u.jsx)(y.Z,{imageSrc:"/images/dashboard/empty-orders-page.png",heading:(null===(r=D[F])||void 0===r?void 0:r.heading)||"Oops, You Haven't Placed an Order Yet",subtext:(null===(t=D[F])||void 0===t?void 0:t.subtext)||"Browse from our freshly picked flowers, suitable for any occasion of your choice.",ctaLabel:"Browse Flowers",ctaUrl:"/product-category/flowers-for-love-birthday-anniversary-etc"}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:w().grid,children:R.map((function(e){return(0,u.jsx)(_.Z,{order:e,onDelete:te},e.id)}))}),(0,u.jsx)("div",{ref:function(e){return C&&!z&&V(e)},className:w().sentinel}),z&&(0,u.jsx)("img",{src:"/images/spinner.svg",alt:"loader",className:"generic-icon xl spinner"})]})]})]})}},1170:function(e){e.exports={header:"orders_header__Ic4xt",title:"orders_title__lJAJw",filters:"orders_filters__04ELS",filter:"orders_filter__D83xp",grid:"orders_grid__7vsij",sentinel:"orders_sentinel__nfgq3"}}},function(e){e.O(0,[791,665,774,888,179],(function(){return r=8700,e(e.s=r);var r}));var r=e.O();_N_E=r}]);

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.