2024-12-05 07:03:33 +00:00
|
|
|
"use strict";(()=>{var e={};e.id=5109,e.ids=[636,5109],e.modules={30671:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,t){return t in r?r[t]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,t)):"function"==typeof r&&"default"===t?r:void 0}}})},93701:(e,r,t)=>{t.r(r),t.d(r,{config:()=>A,default:()=>v,getServerSideProps:()=>b,getStaticPaths:()=>k,getStaticProps:()=>P,reportWebVitals:()=>j,routeModule:()=>N,unstable_getServerProps:()=>D,unstable_getServerSideProps:()=>E,unstable_getStaticParams:()=>w,unstable_getStaticPaths:()=>_,unstable_getStaticProps:()=>M});var s={};t.r(s),t.d(s,{default:()=>q,getServerSideProps:()=>S});var i=t(63865),a=t(9455),u=t(30671),l=t(49407),o=t(68268),n=t(8732),c=t(82015),p=t.n(c),d=t(93615),m=t.n(d),x=t(64987),h=t(21498);function y({data:e}){return(0,n.jsx)(p().Fragment,{children:(0,n.jsxs)("section",{className:"items-start justify-start p-6",children:[(0,n.jsxs)("div",{className:"flex flex-row items-center w-full gap-20 mb-6 justify-between",children:[(0,n.jsx)("h2",{className:"text-xl m-0",children:"Users"}),(0,n.jsx)("a",{href:"/su/users/new",className:"button",children:"Add User"})]}),(0,n.jsx)("div",{className:"flex-col items-stretch gap-10 w-full",children:e.users.map((e,r)=>(0,n.jsx)(h.A,{userObject:e},r+1))})]})})}var f=t(67216),g=t.n(f);function q({user:e,data:r}){let t=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("title",{children:"User Dashboard | Datasquirel"}),(0,n.jsx)("meta",{name:"description",content:"Welcome to your data app"})]});return(0,n.jsx)(x.A,{head:t,user:e,children:(0,n.jsx)(y,{data:r})})}async function S({req:e,res:r,query:t}){let s=await m()(e);return s?.logged_in_status?{props:{user:s,data:{users:(await g()("SELECT * FROM users")).reverse()}}}:{redirect:{destination:"/su/login",permanent:!1}}}let v=(0,u.M)(s,"default"),P=(0,u.M)(s,"getStaticProps"),k=(0,u.M)(s,"getStaticPaths"),b=(0,u.M)(s,"getServerSideProps"),A=(0,u.M)(s,"config"),j=(0,u.M)(s,"reportWebVitals"),M=(0,u.M)(s,"unstable_getStaticProps"),_=(0,u.M)(s,"unstable_getStaticPaths"),w=(0,u.M)(s,"unstable_getStaticParams"),D=(0,u.M)(s,"unstable_getServerProps"),E=(0,u.M)(s,"unstable_getServerSideProps"),N=new i.PagesRouteModule({definition:{kind:a.A.PAGES,page:"/su/users",pathname:"/su/users",bundlePath:"",filename:""},components:{App:o.default,Document:l.default},userland:s})},21498:(e,r,t)=>{t.d(r,{A:()=>u});var s=t(8732),i=t(82015),a=t.n(i);function u({userObject:e,userPage:r}){let t=Object.keys(e),[i,u]=a().useState(!1),[l,o]=a().useState(0),[n,c]=a().useState(!r);return(0,s.jsxs)("div",{className:"card col green w-full overflow-hidden"+(n?r?" h-[100px]":" h-[85px]":" "),children:[(0,s.jsxs)("div",{className:"items-center w-full",children:[(0,s.jsx)("img",{src:e.image_thumbnail,alt:"",className:"rounded-full object-cover"+(r?" w-16 h-16":" w-12 h-12")}),!r&&(0,s.jsxs)("h3",{className:"m-0 text-xl",children:[e.first_name," ",e.last_name," "]}),(0,s.jsxs)("div",{className:"ml-auto",children:[(0,s.jsx)("button",{className:"outlined gray small-text",onClick:e=>{n?c(!1):c(!0)},children:n?"More Details":"Collapse"}),!r&&(0,s.jsx)("a",{href:`/su/users/${e.id}`,className:"button outlined gray small-text",children:"View User"})]})]}),(0,s.jsx)("div",{className:"card no-hover col w-full light-gray-bg",children:t.map((r,i)=>(0,s.jsxs)(a().Fragment,{children:[(0,s.jsx)("div",{children:(0,s.jsxs)("span",{style:{wordBreak:"break-all"},children:[r,":"," ",(0,s.jsx)("b",{children:e[r]})]})}),i<t.length-1&&(0,s.jsx)("hr",{})]},i+1))}),(0,s.jsx)("button",{className:"outlined gray small-text w-full",onClick:e=>{c(!0)},children:"Collapse"})]})}},67105:(e,r,t)=>{t.d(r,{A:()=>s});let s=(0,t(82544).A)("CloudUpload",[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M12 12v9",key:"192myk"}],["path",{d:"m16 16-4-4-4 4",key:"119tzi"}]])},26628:(e,r,t)=>{t.d(r,{A:()=>s});let s=(0,t(82544).A)("DatabaseBackup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k
|