(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4076],{6892:(e,a,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/[user_id]/databases/[single]/edit-database",function(){return t(8708)}])},8064:(e,a,t)=>{"use strict";t.d(a,{A:()=>r});var s=t(4848);function r(e){var a;let{database:t,user:r}=e,d=null===(a=t.active_clone_parent_db)||void 0===a?void 0:a.replace(/datasquirel_user_\d+_/,""),l="/admin/".concat(null==r?void 0:r.id,"/databases/").concat(d);return(0,s.jsx)("div",{className:"info green",children:(0,s.jsxs)("span",{className:"text font-normal",children:["This database is an active clone of"," ",(0,s.jsx)("b",{children:(0,s.jsx)("a",{href:l,target:"_blank",className:"query-url",children:d})})]})})}t(6540)},7220:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(5737).A)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},7290:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(5737).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},4266:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(5737).A)("FileInput",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]])},3419:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(5737).A)("FolderOutput",[["path",{d:"M2 7.5V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-1.5",key:"1yk7aj"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m5 10-3 3 3 3",key:"1r8ie0"}]])},6051:(e,a,t)=>{"use strict";t.d(a,{A:()=>s});let s=(0,t(5737).A)("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]])},8708:(e,a,t)=>{"use strict";t.r(a),t.d(a,{EditDatabaseContext:()=>b,__N_SSP:()=>j,default:()=>v});var s=t(4848),r=t(6540),d=t(4725),l=t(2592),n=t(5844),i=t(3647),c=t(1710),h=t(5481),u=t(2778);function x(){let{user:e,dbImage:a,setDbImage:t,database:d}=r.useContext(b),[l,n]=r.useState(!1);return r.useRef(),(0,s.jsx)("section",{className:"paper",children:(0,s.jsxs)("div",{className:"w-full grid grid-cols-1 xl:grid-cols-2 gap-6 items-stretch",children:[l&&(0,s.jsx)(c.A,{}),(0,s.jsxs)("div",{className:"flex-col items-start w-full xl:w-auto",children:[(0,s.jsx)("h2",{className:"text-xl m-0 text-left w-full",children:"Update Database Information"}),e&&a?(0,s.jsx)(h.A,{user:e,dbImage:a,setDbImage:t,database:d,setLoading:n}):(0,s.jsx)("span",{children:"No User and Database Image present"})]}),e&&a&&t?(0,s.jsx)(u.A,{user:e,dbImage:a,setDbImage:t,database:d}):(0,s.jsx)("span",{children:"Database Image could not be rendered"})]})})}var o=t(8064);function m(){let{database:e,user:a}=r.useContext(b);return(0,s.jsxs)(r.Fragment,{children:[(0,s.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,s.jsxs)("div",{className:"",children:[(0,s.jsx)(n.A,{}),(0,s.jsxs)("h1",{className:"text-3xl m-0",children:["Edit"," ",(0,s.jsx)("span",{className:"px-2 bg-slate-100 dark:bg-white/10 border border-solid border-slate-300 dark:border-slate-300/20 rounded py-1",children:null==e?void 0:e.db_name})]})]}),(0,s.jsx)(i.A,{user:a})]}),(null==e?void 0:e.active_clone)&&a?(0,s.jsx)(o.A,{database:e,user:a}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)(x,{})]})}var p=t(1990),j=!0;let b=r.createContext({});function v(e){let{user:a,database:t,query:n}=e,i=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("title",{children:"Add Database | Datasquirel"}),(0,s.jsx)("meta",{name:"description",content:"Add a database"})]}),[c,h]=r.useState(t.db_image);return(0,s.jsx)(b.Provider,{value:{user:a,database:t,dbImage:c,setDbImage:h},children:(0,s.jsxs)(r.Fragment,{children:[(0,s.jsx)(d.A,{head:i,extraHeaderContent:(0,s.jsx)(p.A,{database:t,query:n,user:a}),children:(0,s.jsx)(m,{})}),(0,s.jsx)(l.A,{setDbImage:h})]})})}}},e=>{var a=a=>e(e.s=a);e.O(0,[1335,3348,4725,675,331,636,6593,8792],()=>a(6892)),_N_E=e.O()}]);