(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[407],{5833:(e,t,r)=>{"use strict";r.d(t,{DeleteServerButton:()=>d});var s=r(54568),a=r(44968),n=r(79748),i=r(7620),l=r(45571);function d({serverId:e}){let t=(0,n.useRouter)(),[r,d]=(0,i.useState)(!1),[o,u]=(0,i.useState)(!1);async function c(){u(!0);try{await fetch(`/api/linux-servers/${e}`,{method:"DELETE"}),t.refresh(),d(!1)}catch(e){console.error("Failed to delete server",e),alert("Failed to delete server")}finally{u(!1)}}return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>d(!0),className:"inline-flex items-center justify-center p-2 rounded-md border border-[hsl(var(--border))] text-red-400 hover:text-white hover:bg-red-500/20 hover:border-red-500/30 transition-all",title:"Delete Server",children:(0,s.jsx)(a.A,{className:"w-4 h-4"})}),(0,s.jsx)(l.B,{isOpen:r,onClose:()=>d(!1),onConfirm:c,title:"Delete Linux Server",message:"Are you sure you want to permanently delete this Linux server configuration? All associated backup history and job logs will be permanently erased. This action cannot be undone.",isDeleting:o})]})}},34784:(e,t,r)=>{Promise.resolve().then(r.bind(r,5833)),Promise.resolve().then(r.t.bind(r,65587,23))},44968:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(13454).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},45571:(e,t,r)=>{"use strict";r.d(t,{B:()=>l});var s=r(54568),a=r(63264),n=r(58299),i=r(44968);function l({isOpen:e,onClose:t,onConfirm:r,title:l,message:d,isDeleting:o}){return e?(0,s.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm animate-in fade-in duration-200",children:(0,s.jsx)("div",{className:"bg-[#111111] border border-[hsl(var(--border))] rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200",children:(0,s.jsxs)("div",{className:"p-6",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-full bg-red-500/10 flex items-center justify-center mb-4",children:(0,s.jsx)(a.A,{className:"w-6 h-6 text-red-500"})}),(0,s.jsx)("h2",{className:"text-xl font-bold text-white mb-2",children:l}),(0,s.jsx)("p",{className:"text-[hsl(var(--muted-foreground))] text-sm leading-relaxed mb-6",children:d}),(0,s.jsxs)("div",{className:"flex gap-3 justify-end mt-8",children:[(0,s.jsx)("button",{onClick:t,disabled:o,className:"px-4 py-2 text-sm font-medium rounded-lg border border-[hsl(var(--border))] text-white hover:bg-white/5 transition-colors disabled:opacity-50",children:"Cancel"}),(0,s.jsx)("button",{onClick:r,disabled:o,className:"px-4 py-2 text-sm font-medium rounded-lg flex items-center gap-2 text-white bg-red-600 hover:bg-red-700 transition-colors disabled:opacity-50",children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.A,{className:"w-4 h-4 animate-spin"})," Deleting..."]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.A,{className:"w-4 h-4"})," Delete Server"]})})]})]})})}):null}},58299:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(13454).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},63264:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(13454).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},79748:(e,t,r)=>{"use strict";var s=r(79796);r.o(s,"useParams")&&r.d(t,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})}},e=>{e.O(0,[8298,587,1968,7358],()=>e(e.s=34784)),_N_E=e.O()}]);