(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9274],{5346:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/Manager/Files/Delete/[id]",function(){return s(7594)}])},9413:function(e,t,s){"use strict";var i=s(5893),l=s(1664),r=s.n(l),n=s(1163);let a=e=>{let{title:t,children:s,create:l}=e,a=(0,n.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}),l&&(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 l=e=>{let{type:t,label:s,className:l,onClick:r,icon:n,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"+(l?" "+l:""),type:t,onClick:r,id:a,children:[n,s]})};t.Z=l},7594:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return m}});var i=s(5893),l=s(4184),r=s(9413),n=s(1664),a=s.n(n),c=s(5911),d=s(9552),h=s.n(d),o=s(2920),u=s(1163),x=s(5675),f=s.n(x);let j=e=>{let{status:t,data:s}=e,n="http://localhost:8000/files/"+s.path,d=(0,u.useRouter)(),x=()=>{let e=h().get("token");fetch("/api/file/delete/"+s.id,{method:"DELETE",headers:{Authorization:"bearer "+e}}).then(async e=>{200===e.status?(o.Am.success("با موفقیت حذف شد!"),d.push("/Files")):o.Am.error("خطا!")})};return(0,i.jsx)(l.Z,{title:"پست ها - حذف: "+s.alt,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",{className:"mb-2",children:[" فایل:","image"===s.type?(0,i.jsx)(f(),{loader:()=>n,src:n,alt:s.alt,width:500,height:500,priority:!0},s.id):"video"===s.type?(0,i.jsx)("video",{width:500,height:"auto",controls:!0,children:(0,i.jsx)("source",{src:n+"?dl=0"})},s.id):(0,i.jsx)("div",{children:"file"},s.id)]}),(0,i.jsxs)("li",{children:["شناسه: ",s.id]}),(0,i.jsxs)("li",{children:["متن جایگزین: ",s.alt]}),(0,i.jsxs)("li",{children:["نوع: ",s.type]})]}),(0,i.jsxs)("div",{className:"mt-5 text-left",children:[(0,i.jsx)(a(),{href:"/Files/Edit/"+s.id,children:"لغو"}),(0,i.jsx)(c.Z,{label:"تایید",type:"button",className:"mr-2",onClick:x})]})]})})};var m=!0;t.default=j}},function(e){e.O(0,[4617,1057,3874,699,4184,9774,2888,179],function(){return e(e.s=5346)}),_N_E=e.O()}]);