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