dsql-admin/dsql-app/.local_dist/static/chunks/820-56dea9360dca328f.js

1 line
3.4 KiB
JavaScript
Raw Normal View History

2024-12-08 19:56:57 +00:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[820],{75849:(e,t,s)=>{s.d(t,{A:()=>v});var a=s(74848),l=s(96540),n=s(55436),r=s(4709),i=s(55624);s(67720);var c=s(82171);function d(e){let{databases:t,setTargetDatabase:s,user:r}=l.useContext(n.DashboardContext);return(0,a.jsx)(l.Fragment,{children:(0,a.jsx)(c.A,{databases:t,setTargetDatabase:s,title:"Recently added Databases",more:!0,user:r})})}var o=s(56417),x=s(59140),u=s(18190),h=s(1915);let m=(0,s(95737).A)("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);function j(e){let{icon:t,metric:s,count:l,url:n}=e;return(0,a.jsxs)("a",{href:n,className:"card col w-full",children:[(0,a.jsx)("div",{className:"absolute top-4 right-4",children:t}),(0,a.jsxs)("div",{className:"content-block",children:[(0,a.jsx)("span",{className:"metric text-slate-800 dark:text-white",children:l}),(0,a.jsx)("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:s})]})]})}function y(e){let{databases:t,setTargetDatabase:s,metrics:r,user:i}=l.useContext(n.DashboardContext);return(0,a.jsx)("section",{className:"p-0",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 w-full gap-6 items-stretch",children:[(0,a.jsx)(j,{metric:"Databases Created",count:(null==r?void 0:r.dbCount)||0,icon:(0,a.jsx)(x.A,{size:20,className:"text-secondary2"}),url:"/admin/".concat(null==i?void 0:i.id,"/databases")}),(0,a.jsx)(j,{metric:"Tables Created",count:(null==r?void 0:r.tablesCount)||0,icon:(0,a.jsx)(u.A,{size:20,className:"text-primary"})}),(0,a.jsx)(j,{metric:"Media Added",count:(null==r?void 0:r.mediaCount)||0,icon:(0,a.jsx)(h.A,{size:20,className:"text-slate-500"}),url:"/admin/".concat(null==i?void 0:i.id,"/media")}),(0,a.jsx)(j,{metric:"API Keys",count:(null==r?void 0:r.apiKeysCount)||0,icon:(0,a.jsx)(m,{size:20,className:"text-slate-900 dark:text-white"}),url:"/admin/".concat(null==i?void 0:i.id,"/api-keys")})]})})}function v(e){var t;let{databases:s,user:c}=l.useContext(n.DashboardContext);return(0,a.jsxs)(l.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-col items-start gap-0",children:[(0,a.jsx)("h1",{className:"text-3xl m-0",children:"Dashboard"}),(0,a.jsx)(r.A,{user:c})]}),(null==c?void 0:null===(t=c.verification_status)||void 0===t?void 0:t.toString().match(/1/))?(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)(y,{}),(0,a.jsx)(d,{}),(0,a.jsx)(o.A,{user:c})]}):(0,a.jsx)(i.A,{})]})}},18190:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(95737).A)("Sheet",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"3",x2:"21",y1:"9",y2:"9",key:"1vqk6q"}],["line",{x1:"3",x2:"21",y1:"15",y2:"15",key:"o2sbyz"}],["line",{x1:"9",x2:"9",y1:"9",y2:"21",key:"1ib60c"}],["line",{x1:"15",x2:"15",y1:"9",y2:"21",key:"1n26ft"}]])},55436:(e,t,s)=>{s.r(t),s.d(t,{DashboardContext:()=>d,__N_SSP:()=>c,default:()=>o});var a=s(74848),l=s(96540),n=s(51187),r=s(75849),i=s(47652),c=!0;let d=l.createContext({});function o(e){let{user:t,databases:s,metrics:c}=e,o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("title",{children:"User Dashboard | Datasquirel"}),(0,a.jsx)("meta",{name:"description",content:"Welcome to your data app"})]}),[x,u]=l.useState(null);return(0,a.jsx)(n.A,{head:o,user:t,children:(0,a.jsxs)(d.Provider,{value:{user:t,databases:s,targetDatabase:x,setTargetDatabase:u,metrics:c},children:[(0,a.jsx)(r.A,{}),(0,a.jsx)(i.A,{targetDatabase:x})]})})}}}]);