(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9418],{3279:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/Manager/Users/Delete/[id]",function(){return t(1428)}])},9413:function(e,s,t){"use strict";var r=t(5893),n=t(1664),i=t.n(n),l=t(1163);let a=e=>{let{title:s,children:t,create:n}=e,a=(0,l.useRouter)();return(0,r.jsxs)("div",{className:"m-5 shadow rounded-3xl hover:shadow-2xl",children:[(0,r.jsxs)("div",{className:"border-b border-gray-200 py-3 px-4 flex justify-between",children:[(0,r.jsx)("h1",{className:"font-bold text-gray-900",children:s}),n&&(0,r.jsx)(i(),{href:a.route+"/Create",passHref:!0,legacyBehavior:!0,children:(0,r.jsx)("a",{className:"hover:text-green-600",children:(0,r.jsx)("span",{children:"افزودن"})})})]}),(0,r.jsx)("div",{className:"p-4 lg:h-[80vh] overflow-y-auto",children:t})]})};s.Z=a},5911:function(e,s,t){"use strict";var r=t(5893);let n=e=>{let{type:s,label:t,className:n,onClick:i,icon:l,id:a}=e;return(0,r.jsxs)("button",{className:"bg-theme-main text-white py-2 px-5 rounded-lg min-w-[80px] inline-flex items-center justify-center"+(n?" "+n:""),type:s,onClick:i,id:a,children:[l,t]})};s.Z=n},1428:function(e,s,t){"use strict";t.r(s),t.d(s,{__N_SSP:function(){return m}});var r=t(5893),n=t(4184),i=t(9413),l=t(1664),a=t.n(l),c=t(5911),d=t(9552),h=t.n(d),u=t(2920),o=t(1163);let x=e=>{let{status:s,data:t}=e,l=(0,o.useRouter)(),d=()=>{let e=h().get("token");fetch("/api/user/delete/"+t.id,{method:"DELETE",headers:{Authorization:"bearer "+e}}).then(async e=>{200===e.status?(u.Am.success("با موفقیت حذف شد!"),l.push("/Manager/Users")):u.Am.error("خطا!")})};return(0,r.jsx)(n.Z,{title:"کاربران - حذف",children:(0,r.jsxs)(i.Z,{title:"حذف",children:[(0,r.jsx)("p",{children:"آیا از حذف مطمئن هستید؟"}),(0,r.jsxs)("ol",{className:"list-decimal list-inside mt-5",children:[(0,r.jsxs)("li",{children:["شناسه: ",t.id]}),(0,r.jsxs)("li",{children:["نام و نام خانوادگی: ",t.userDetail.first_name," ",t.userDetail.last_name]}),(0,r.jsxs)("li",{children:["شماره: ",t.phone]}),(0,r.jsxs)("li",{children:["ایمیل: ",t.email]})]}),(0,r.jsxs)("div",{className:"mt-5 text-left",children:[(0,r.jsx)(a(),{href:"/Users",children:"لغو"}),(0,r.jsx)(c.Z,{label:"تایید",type:"button",className:"mr-2",onClick:d})]})]})})};var m=!0;s.default=x}},function(e){e.O(0,[4617,1057,3874,699,4184,9774,2888,179],function(){return e(e.s=3279)}),_N_E=e.O()}]);