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