(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3681],{63367:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/[user_id]/users/databases",function(){return a(34222)}])},99862:(e,s,a)=>{"use strict";a.d(s,{A:()=>r});var l=a(74848);a(96540);var t=a(86625);function r(){return(0,l.jsx)("button",{className:"outlined gray p-2 w-9 h-9 flex items-center justify-center rounded-full",onClick:e=>{window.history.back()},children:(0,l.jsx)(t.A,{color:"inherit",className:"opacity-50 text-black",fontSize:"small"})})}},45165:(e,s,a)=>{"use strict";a.d(s,{Ay:()=>n,PB:()=>c,fs:()=>i});var l=a(74848),t=a(76897),r=a(96540);function n(e){let{children:s,title:a,data:n,fullPage:c,wrapperClasses:d,closePopupDispatch:o,wrapperStyle:u,noContainer:p}=e;return c?(0,l.jsxs)("div",{className:"popup-bg overflow-hidden "+(d||""),"data-popupid":a||null,style:u,children:[p?(0,l.jsx)(r.Fragment,{children:s}):(0,l.jsx)("div",{className:"relative w-full h-full z-50","data-data":n?JSON.stringify(n):"",children:s}),(0,l.jsx)("button",{className:"popup-cancel-button fixed outlined gray",onClick:e=>{i(),o&&o()},children:(0,l.jsx)(t.A,{color:"white",size:20})}),(0,l.jsx)("div",{className:"popup-canceller",onClick:e=>{i(),o&&o()}})]}):(0,l.jsxs)("div",{className:"popup-bg","data-popupid":a||null,children:[p?(0,l.jsx)(r.Fragment,{children:s}):(0,l.jsxs)("div",{className:"popup-content-container minimal-scrollbars","data-data":n?JSON.stringify(n):"",children:[s,(0,l.jsx)("button",{className:"outlined gray popup-cancel-button",onClick:e=>{i(),o&&o()},children:(0,l.jsx)("span",{className:"font-normal",children:"✖"})})]}),p&&(0,l.jsx)("button",{className:"gray popup-cancel-button",onClick:e=>{i(),o&&o()},children:(0,l.jsx)("span",{className:"font-normal",children:"✖"})}),(0,l.jsx)("div",{className:"popup-canceller",onClick:e=>{i(),o&&o()}})]})}function c(e,s){let a=document.querySelector("[data-popupid='".concat(e,"']"));a&&(a.style.display="flex",s&&s(a))}function i(e){document.querySelectorAll("[data-popupid]").forEach(e=>{e.style.display="none"}),e&&e()}},86625:(e,s,a)=>{"use strict";var l=a(24994);s.A=void 0;var t=l(a(44888)),r=a(74848);s.A=(0,t.default)((0,r.jsx)("path",{d:"M16.62 2.99c-.49-.49-1.28-.49-1.77 0L6.54 11.3c-.39.39-.39 1.02 0 1.41l8.31 8.31c.49.49 1.28.49 1.77 0s.49-1.28 0-1.77L9.38 12l7.25-7.25c.48-.48.48-1.28-.01-1.76"}),"ArrowBackIosRounded")},94909:(e,s,a)=>{"use strict";a.d(s,{A:()=>l});let l=(0,a(95737).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},34222:(e,s,a)=>{"use strict";a.r(s),a.d(s,{AllDatabasesUsersContext:()=>p,__N_SSP:()=>u,default:()=>x});var l=a(74848),t=a(96540),r=a(51187),n=a(80443),c=a(4709);function i(e){let{databases:s,user:a}=e;return(0,l.jsx)(t.Fragment,{children:(0,l.jsxs)("section",{className:"p-4 items-start gap-4 overflow-visible",children:[(0,l.jsx)("h2",{className:"text-xl m-0",children:"Database Users"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-6",children:s&&s[0]?s.map((e,s)=>(0,l.jsxs)("a",{href:"/admin/".concat(null==a?void 0:a.id,"/users/databases/").concat(e.db_slug),className:"border border-slate-200 border-solid rounded px-6 py-4 hover:border-primary flex items-center gap-2",children:[(0,l.jsx)("img",{src:e.db_image,className:"w-8 h-8 rounded-full object-cover",alt:""}),e.db_name]},s+1)):(0,l.jsx)("span",{children:"No Databases Yet"})})]})})}var d=a(99862);function o(e){let{databases:s,user:a}=t.useContext(p);return(0,l.jsxs)(t.Fragment,{children:[(0,l.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,l.jsxs)("div",{className:"w-full justify-between flex-wrap",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(d.A,{}),(0,l.jsx)("h1",{className:"text-3xl m-0",children:"All Databases Users"})]}),(0,l.jsxs)("a",{href:"/admin/".concat(null==a?void 0:a.id,"/users/add-user"),className:"flex items-center gap-2 whitespace-normal button",children:[(0,l.jsx)("span",{className:"symbol",children:"+"}),(0,l.jsx)("span",{children:"Add New User"})]})]}),(0,l.jsx)(c.A,{user:a})]}),(0,l.jsx)(i,{databases:s,user:a})]})}var u=!0;let p=t.createContext({});function x(e){let{user:s,users:a,databases:c}=e,i=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("title",{children:"Users | Datasquirel"}),(0,l.jsx)("meta",{name:"description",content:"Welcome to your data app"})]}),[d,u]=t.useState(null),[x,m]=t.useState(null);return(0,l.jsx)(r.A,{head:i,user:s,children:(0,l.jsxs)(p.Provider,{value:{user:s,users:a,targetUser:x,setTargetUser:m,databases:c},children:[(0,l.jsx)(o,{}),(0,l.jsx)(n.A,{targetUser:x,user:s,setTargetUser:m})]})})}}},e=>{var s=s=>e(e.s=s);e.O(0,[9799,6946,636,6593,8792],()=>s(63367)),_N_E=e.O()}]);