1import{c,D as m,j as e,aG as h,C as t,d as r,a as p,b as j,Z as u,s as f}from"./index-DaxYHL_c.js";import{B as N}from"./badge-BgIO1kHT.js";import{S as y}from"./smartphone-DFD4mi2y.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const g=c("Apple",[["path",{d:"M12 20.94c1.5 0 2.75 1.06 4 1.06 3 0 6-8 6-12.22A4.91 4.91 0 0 0 17 5c-2.22 0-4 1.44-5 2-1-.56-2.78-2-5-2a4.9 4.9 0 0 0-5 4.78C2 14 5 22 8 22c1.25 0 2.5-1.06 4-1.06Z",key:"3s7exb"}],["path",{d:"M10 2c1 .5 2 2 2 5",key:"fcco2y"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const v=c("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),w=a=>a==="ios"?e.jsx(g,{className:"h-4 w-4"}):a==="android"?e.jsx(y,{className:"h-4 w-4"}):e.jsx(v,{className:"h-4 w-4"});function M(){const{data:a,isLoading:i}=m({queryKey:["app-install-log"],queryFn:async()=>{const{data:s,error:l}=await f.from("app_install_log").select("id, email, platform, source, user_agent, referrer, installed_at").order("installed_at",{ascending:!1}).limit(500);if(l)throw l;return s}}),o=(a==null?void 0:a.length)??0,d=(a??[]).reduce((s,l)=>{const n=l.platform||"unknown";return s[n]=(s[n]??0)+1,s},{}),x=(a??[]).filter(s=>s.email).length;return e.jsxs("div",{className:"p-4 md:p-8 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl md:text-3xl font-display text-foreground flex items-center gap-2",children:[e.jsx(h,{className:"h-7 w-7"})," App Installs"]}),e.jsx("p",{className:"text-muted-foreground",children:"Everyone who has installed the Elite Planner app to their phone or desktop."})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[e.jsx(t,{children:e.jsxs(r,{className:"p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Total installs"}),e.jsx("div",{className:"text-2xl font-semibold",children:o})]})}),e.jsx(t,{children:e.jsxs(r,{className:"p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Signed-in"}),e.jsx("div",{className:"text-2xl font-semibold",children:x})]})}),e.jsx(t,{children:e.jsxs(r,{className:"p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"iOS"}),e.jsx("div",{className:"text-2xl font-semibold",children:d.ios??0})]})}),e.jsx(t,{children:e.jsxs(r,{className:"p-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"Android"}),e.jsx("div",{className:"text-2xl font-semibold",children:d.android??0})]})})]}),e.jsxs(t,{children:[e.jsx(p,{children:e.jsx(j,{className:"text-base",children:"Recent installs"})}),e.jsx(r,{children:i?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Loadingâ¦"}):!a||a.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No installs recorded yet. Installs are logged automatically when a couple adds the app to their home screen."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-left text-muted-foreground border-b",children:[e.jsx("th",{className:"py-2 pr-4",children:"When"}),e.jsx("th",{className:"py-2 pr-4",children:"Device"}),e.jsx("th",{className:"py-2 pr-4",children:"Email"}),e.jsx("th",{className:"py-2 pr-4",children:"Source"}),e.jsx("th",{className:"py-2 pr-4",children:"Referrer"})]})}),e.jsx("tbody",{children:a.map(s=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsx("td",{className:"py-2 pr-4 whitespace-nowrap",children:u(new Date(s.installed_at),"d MMM yyyy HH:mm")}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs(N,{variant:"secondary",className:"gap-1",children:[w(s.platform)," ",s.platform??"â"]})}),e.jsx("td",{className:"py-2 pr-4",children:s.email??e.jsx("span",{className:"text-muted-foreground",children:"guest"})}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground",children:s.source??"â"}),e.jsx("td",{className:"py-2 pr-4 text-muted-foreground truncate max-w-[220px]",children:s.referrer??"â"})]},s.id))})]})})})]})]})}export{M as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.