PageSourceSearch

https://dumart.xyz/_next/static/chunks/pages/dashboard/users-c844c0ed59991a22.js

js dumart.xyz collected 2026-09-26 17:54:51 UTC 6,057 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[501,5885],{25137:function(e,t,a){"use strict";a.d(t,{r:function(){return l}});var r=a(87462),s=a(67294),n=a(54142),l=s.forwardRef(function(e,t){return s.createElement(n.r,(0,r.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 16 16"},e,{ref:t}),s.createElement("path",{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"}),s.createElement("path",{fillRule:"evenodd",d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"}))});l.displayName="Trash"},48045:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/users",function(){return a(17953)}])},16494:function(e,t,a){"use strict";a.d(t,{Z:function(){return Table}});var r=a(85893);a(5152);var s=a(67294),n=a(90044),l=a(18813),o=a.n(l),filter=e=>{let{filterText:t,onFilter:a,onClear:s,placeholder:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{id:"search",type:"text",placeholder:"Filter By ".concat(n||"Name"),"aria-label":"Search Input",className:o().search_bar,value:t,onChange:a}),(0,r.jsx)("button",{type:"button",className:o().search_bar_button,onClick:s,children:"X"})]})};function Table(e){let{data:t,columns:a,searchKey:l,searchPlaceholder:o}=e,[c,i]=s.useState(""),[u,d]=s.useState(!1),_=t.filter(e=>e[l]&&e[l].toLowerCase().includes(c.toLowerCase())),h=s.useMemo(()=>(0,r.jsx)(filter,{onFilter:e=>i(e.target.value),onClear:()=>{c&&(d(!u),i(""))},filterText:c,placeholder:o}),[c,u]);return(0,r.jsx)(n.default,{columns:a,data:_,pagination:!0,paginationPageSize:100,paginationResetDefaultPage:u,subHeader:!0,subHeaderComponent:h,persistTableHead:!0,customStyles:{rows:{style:{minHeight:"70px",fontSize:"14px",fontWeight:500}},headCells:{style:{fontSize:"15px",fontWeight:600}}}})}},42444:function(e,t,a){"use strict";var r=a(85893),s=a(67294),n=a(59734),l=a(75885),o=a(37449),c=a(18214);let i=(0,s.forwardRef)((e,t)=>{let{data:a,error:i,mutate:u}=(0,n.ZP)(e.url?e.url:null,o.gN);return((0,s.useImperativeHandle)(t,()=>({update:()=>{u()}})),(0,s.useEffect)(()=>{a&&a.success&&e&&e.setData(a)},[a]),i)?(0,r.jsx)(l.default,{}):a?a&&!a.success?(0,r.jsx)(l.default,{}):(0,r.jsxs)(r.Fragment,{children:[" ",e.children," "]}):(0,r.jsx)("div",{style:{height:"100vh"},children:(0,r.jsx)(c.default,{})})});t.Z=i},75885:function(e,t,a){"use strict";a.r(t);var r=a(85893),s=a(41664),n=a.n(s),l=a(69032),o=a.n(l);t.default=()=>(0,r.jsx)("div",{className:o().body,children:(0,r.jsx)("div",{className:o().body_container,children:(0,r.jsxs)("div",{className:o().ntfnd,children:[(0,r.jsx)("div",{className:o().error,children:(0,r.jsx)("h1",{children:"500"})}),(0,r.jsx)("h2",{children:"Oooops! Internal Server Error."}),(0,r.jsxs)("p",{children:["That is, something went terribly wrong. We suggest you to go back or visit here later",(0,r.jsx)("br",{}),(0,r.jsx)(n(),{href:"/",children:"Return to homepage"})]})]})})})},17953:function(e,t,a){"use strict";a.r(t);var r=a(85893),s=a(25137),n=a(5152),l=a.n(n),o=a(67294),c=a(25617),i=a(22920),u=a(16494),d=a(71178),_=a.n(d),h=a(42444),b=a(37449);let m=l()(()=>a.e(3347).then(a.bind(a,3347)),{loadableGenerated:{webpack:()=>[3347]}}),SubscriberList=()=>{let[e,t]=(0,o.useState)({users:[]}),a=(0,o.useRef)(),[n,l]=(0,o.useState)(!1),[d,f]=(0,o.useState)(""),{session:x}=(0,c.v9)(e=>e.localSession),[p,j]=(0,o.useState)({});(0,o.useEffect)(()=>{j((0,b.wn)(x,"customers"))},[x]);let openModal=e=>{f(e),l(!0)},closeModal=()=>{l(!1)},deleteSubscriber=async()=>{l(!1),await (0,b.SR)("/api/users?id=".concat(d)).then(e=>e.success?(i.Am.success("Customer Deleted Successfully"),void a.current.update()):i.Am.error("Something Went Wrong")).catch(e=>{console.log(e),i.Am.error("Something Went Wrong")})};return(0,r.jsx)(h.Z,{url:"/api/users",setData:t,ref:a,children:(0,r.jsxs)("div",{children:[(0,r.jsx)("h4",{className:"text-center pt-3 pb-5",children:"Customers"}),(0,r.jsxs)("div",{className:_().container,children:[(0,r.jsx)(u.Z,{columns:[{name:"Name",selector:e=>e.name},{name:"email",selector:e=>e.email},{name:"Phone",selector:e=>e.phone},{name:"Created",selector:e=>(0,b.vc)(e.createdAt),sortable:!0},{name:"Total Order",selector:e=>e.orders.length,sortable:!0},{name:"Action",selector:e=>p.delete&&(0,r.jsx)("div",{className:_().button,onClick:()=>openModal(e._id),children:(0,r.jsx)(s.r,{width:22,height:22,title:"DELETE"})})}],data:e.users,searchKey:"email",searchPlaceholder:"Email"}),(0,r.jsx)(m,{isOpen:n,handleCloseModal:closeModal,small:!0,children:(0,r.jsxs)("div",{className:_().modal_icon,children:[(0,r.jsx)(s.r,{width:90,height:90}),(0,r.jsx)("p",{children:"Are you sure, you want to delete?"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("button",{className:_().danger_button,onClick:()=>deleteSubscriber(),children:"Delete"}),(0,r.jsx)("button",{className:_().success_button,onClick:()=>closeModal(),children:"Cancel"})]})]})})]})]})})};SubscriberList.requireAuthAdmin=!0,SubscriberList.dashboard=!0,t.default=SubscriberList},18813:function(e){e.exports={container:"table_container__TP04p",button:"table_button__ZP8R5",modal_icon:"table_modal_icon__wZblj",danger_button:"table_danger_button__QN6jY",success_button:"table_success_button__G61zr",color_viewer:"table_color_viewer__IY131",search_bar:"table_search_bar__j9gvC",search_bar_button:"table_search_bar_button__domkf"}},71178:function(e){e.exports={container:"table_container__f1mC4",button:"table_button__LF8_5",modal_icon:"table_modal_icon__t_aHR",danger_button:"table_danger_button__jpS_l",success_button:"table_success_button__lcGr5",color_viewer:"table_color_viewer__54oBu",search_bar:"table_search_bar__anNGy",search_bar_button:"table_search_bar_button__OjZ8a"}}},function(e){e.O(0,[44,9774,2888,179],function(){return e(e.s=48045)}),_N_E=e.O()}]);

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.