(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9334],{42065:function(e,s,a){"use strict";var n=a(64836);s.Z=void 0;var t=n(a(64938)),r=a(85893),l=(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.76z"}),"ArrowBackIosRounded");s.Z=l},69594:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/[user_id]/users/databases",function(){return a(23666)}])},61781:function(e,s,a){"use strict";a.d(s,{Z:function(){return r}});var n=a(85893),t=(a(67294),a(42065));function r(){return(0,n.jsx)("button",{className:"outlined gray p-2 w-9 h-9 flex items-center justify-center rounded-full",onClick:function(e){window.history.back()},children:(0,n.jsx)(t.Z,{color:"inherit",className:"opacity-50 text-black",fontSize:"small"})})}},25472:function(e,s,a){"use strict";a.d(s,{Mw:function(){return c},ZP:function(){return l},j4:function(){return i}});var n=a(85893),t=a(41352),r=a(67294);function l(e){var s=e.children,a=e.title,l=e.data,c=e.fullPage,o=e.wrapperClasses,u=e.closePopupDispatch,d=e.wrapperStyle,p=e.noContainer;return c?(0,n.jsxs)("div",{className:"popup-bg overflow-hidden "+(o||""),"data-popupid":a||null,style:d,children:[p?(0,n.jsx)(r.Fragment,{children:s}):(0,n.jsx)("div",{className:"relative w-full h-full z-50","data-data":l?JSON.stringify(l):"",children:s}),(0,n.jsx)("button",{className:"popup-cancel-button fixed outlined gray",onClick:function(e){i(),u&&u()},children:(0,n.jsx)(t.Z,{color:"white",size:20})}),(0,n.jsx)("div",{className:"popup-canceller",onClick:function(e){i(),u&&u()}})]}):(0,n.jsxs)("div",{className:"popup-bg","data-popupid":a||null,children:[p?(0,n.jsx)(r.Fragment,{children:s}):(0,n.jsxs)("div",{className:"popup-content-container minimal-scrollbars","data-data":l?JSON.stringify(l):"",children:[s,(0,n.jsx)("button",{className:"outlined gray popup-cancel-button",onClick:function(e){i(),u&&u()},children:(0,n.jsx)("span",{className:"font-normal",children:"\u2716"})})]}),p&&(0,n.jsx)("button",{className:"gray popup-cancel-button",onClick:function(e){i(),u&&u()},children:(0,n.jsx)("span",{className:"font-normal",children:"\u2716"})}),(0,n.jsx)("div",{className:"popup-canceller",onClick:function(e){i(),u&&u()}})]})}function c(e,s){var a=document.querySelector("[data-popupid='".concat(e,"']"));a&&(a.style.display="flex",s&&s(a))}function i(e){document.querySelectorAll("[data-popupid]").forEach((function(e){e.style.display="none"})),e&&e()}},23666:function(e,s,a){"use strict";a.r(s),a.d(s,{AllDatabasesUsersContext:function(){return x},__N_SSP:function(){return f},default:function(){return m}});var n=a(828),t=a(85893),r=a(67294),l=a(54858),c=a(9417),i=a(424);function o(e){var s=e.databases,a=e.user;return(0,t.jsx)(r.Fragment,{children:(0,t.jsxs)("section",{className:"p-4 items-start gap-4 overflow-visible",children:[(0,t.jsx)("h2",{className:"text-xl m-0",children:"Database Users"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-6",children:s&&s[0]?s.map((function(e,s){return(0,t.jsxs)("a",{href:"/admin/".concat(null===a||void 0===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,t.jsx)("img",{src:e.db_image,className:"w-8 h-8 rounded-full object-cover",alt:""}),e.db_name]},s+1)})):(0,t.jsx)("span",{children:"No Databases Yet"})})]})})}var u=a(61781);function d(e){var s=r.useContext(x),a=s.databases,n=s.user;return(0,t.jsxs)(r.Fragment,{children:[(0,t.jsxs)("div",{className:"flex-col items-start gap-0 w-full",children:[(0,t.jsxs)("div",{className:"w-full justify-between flex-wrap",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(u.Z,{}),(0,t.jsx)("h1",{className:"text-3xl m-0",children:"All Databases Users"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null===n||void 0===n?void 0:n.id,"/users/add-user"),className:"flex items-center gap-2 whitespace-normal button",children:[(0,t.jsx)("span",{className:"symbol",children:"+"}),(0,t.jsx)("span",{children:"Add New User"})]})]}),(0,t.jsx)(i.Z,{user:n})]}),(0,t.jsx)(o,{databases:a,user:n})]})}var p={},f=!0,x=r.createContext(p);function m(e){var s=e.user,a=e.users,i=e.databases,o=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("title",{children:"Users | Datasquirel"}),(0,t.jsx)("meta",{name:"description",content:"Welcome to your data app"})]}),u=(0,n.Z)(r.useState(null),2),p=(u[0],u[1],(0,n.Z)(r.useState(null),2)),f=p[0],m=p[1];return(0,t.jsx)(l.Z,{head:o,user:s,children:(0,t.jsxs)(x.Provider,{value:{user:s,users:a,targetUser:f,setTargetUser:m,databases:i},children:[(0,t.jsx)(d,{}),(0,t.jsx)(c.Z,{targetUser:f,user:s,setTargetUser:m})]})})}}},function(e){e.O(0,[9365,5949,9774,2888,179],(function(){return s=69594,e(e.s=s);var s}));var s=e.O();_N_E=s}]);