text: (self.webpackChunkbarbershop=self.webpackChunkbarbershop||[]).push([[9300],{19300:function(e,a,n){"use strict";n.r(a),n.d(a,{default:function(){return H}});var r=n(63038),t=n.n(r),c=n(67294),o=n(84751),l=n(79521),s=(n(65694),n(16550)),u=n(15616),i=n.n(u),d=function(e,a,n){var r=(0,o.v9)((function(e){return e.canceledOrderData})),t=(0,s.k6)();return{columns:(0,c.useMemo)((function(){return[{Header:"Name Surname",accessor:"name"},{Header:"Date canceling",accessor:"date",Cell:function(e){var a=e.value;return i()(new Date(a),"dd/MM/yyyy")}},{Header:"Time canceling",accessor:"cancelTime",Cell:function(e){var a=e.value;return i()(new Date(a),"HH:mm")}},{Header:"Hairdresser",accessor:"hairdresserName"},{Header:"Details",disableSortBy:!0,id:"details",accessor:function(e){return"details"},Cell:function(e){return c.createElement("button",{className:"admin-canceled__btn-remove",onClick:function(){t.push("/admin/details-canceled-order/".concat(e.row.original._id))}},"Details")}},{Header:"Remove",disableSortBy:!0,id:"remove",accessor:function(e){return"remove"},Cell:function(r){return c.createElement("button",{className:"admin-canceled__btn-remove",onClick:function(){n(!0),e(r.row.original._id),a(r.row.original.cancelCode)}},c.createElement("i",{className:"fas fa-trash-alt"}))}}]}),[r]),data:(0,c.useMemo)((function(){return r}),[r])}},m=n(76961),p=n(73637),v=n(21696),f=n(73680),g=n(16431),b=n(22584),h=n(87757),P=n.n(h),w=n(48926),y=n.n(w),C=n(73406),E=n(65467),N=n(58860),D=function(e,a){var n=(0,o.I0)();return{handleRemoveItem:function(){var r=y()(P().mark((function r(){var t,c;return P().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(0,E.Lr)(e);case 2:t=r.sent,c=t.data,200===t.status?(n((0,C.Ob)(c.success,"removeAtTableAdmin")),n((0,N.jo)(e)),a(!1)):n((0,C.PA)(c.alert,"removeAtTableAdmin"));case 6:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}()}},H=function(){(0,o.I0)();var e=(0,o.v9)((function(e){return e.useAdminData})),a=(0,o.v9)((function(e){return e.canceledOrderData})),n=(0,o.v9)((function(e){return e.alertData})),r=(0,c.useState)(null),s=t()(r,2),u=s[0],i=s[1],h=(0,c.useState)(null),P=t()(h,2),w=(P[0],P[1]),y=(0,c.useState)(!1),C=t()(y,2),E=C[0],N=C[1],H=d(i,w,N),T=H.columns,k=H.data,x=D(u,N).handleRemoveItem;(0,b.Z)();var I=(0,l.useTable)({columns:T,data:k},l.useGlobalFilter,l.useSortBy,l.usePagination),S=I.getTableProps,_=I.getTableBodyProps,A=I.headerGroups,R=I.page,M=I.nextPage,O=I.previousPage,Z=I.canNextPage,B=I.canPreviousPage,F=I.pageOptions,G=I.prepareRow,j=I.state,L=I.setGlobalFilter,q=j.globalFilter,z=j.pageIndex;return c.createElement("article",{className:"admin-canceled"},(n.errorServerMsg,c.createElement(g.Z,null)),c.createElement("div",{className:"admin-canceled__wrapper"},c.createElement(p.Z,{data:a,filter:q,setFilter:L}),c.createElement(v.Z,{getTableProps:S,getTableBodyProps:_,headerGroups:A,page:R,prepareRow:G}),c.createElement(m.Z,{canNextPage:Z,canPreviousPage:B,nextPage:M,pageIndex:z,pageOptions:F,previousPage:O}),c.createElement(f.Z,{enableAction:e.enableCancel,isOpenModal:E,handleRemoveItem:x,handleNotRemoveItem:function(){N(!1)},purpose:"order"})))}},65694:function(){}}]);