PageSourceSearch

https://ymove.app/_next/static/chunks/pages/dashboard/user-stats-6deb4fb8dcfd756d.js

js ymove.app collected 2026-10-01 14:17:50 UTC 4,684 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2064],{31890:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/user-stats",function(){return s(3969)}])},3969:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return h}});var r=s(85893),a=s(67294),l=s(92729),o=s(23148),d=s(26495),n=s(28593),i=s(11163);o.kL.register(o.uw,o.f$,o.od,o.jn,o.Dx,o.u,o.De);let c=null,x=e=>{var t;let s=null==e?void 0:null===(t=e.site)||void 0===t?void 0:t.id,o=e.user,[x,h]=(0,a.useState)(null),[m,u]=(0,a.useState)(!0),[p,y]=(0,a.useState)(null),g=e.userIsLoading,j=(0,i.useRouter)(),{generate:b}=j.query;if((0,a.useEffect)(()=>{if(c)h(c);else if(!g){let e=async()=>{try{let e="https://v6-beta-api.ymove.app/api/site/".concat(s,"/user-activity-stats").concat("yes"===b?"?generate=yes":""),t=await l.Z.get(e,{headers:{Accept:"application/json","X-Authorization":"Bearer ".concat(o.jwt),"Cache-Control":"no-cache"}});h(t.data),c=t.data}catch(r){console.log("@@@ error",r),y("Failed to fetch stats")}finally{u(!1)}};e()}},[s,g,o,b]),g)return(0,r.jsx)("div",{children:"Loading user..."});if(m)return(0,r.jsx)("p",{className:"text-center text-gray-500",children:"Loading..."});if(p)return(0,r.jsx)("p",{className:"text-center text-red-500",children:p});if(!x)return null;let N={labels:x.workoutSessionsPerDay.map(e=>e.date),datasets:[{label:"Workout Sessions",data:x.workoutSessionsPerDay.map(e=>e.count),backgroundColor:"rgba(75, 192, 192, 0.2)",borderColor:"rgba(75, 192, 192, 1)",borderWidth:1}]};return(0,r.jsxs)(n.Z,{userIsLoading:g,user:e.user,site:e.site,meta:{title:"Dashboard"},children:[(0,r.jsx)("h1",{children:"User Stats "}),(0,r.jsx)("br",{}),(0,r.jsxs)("div",{className:"container mx-auto",children:[(0,r.jsx)("h3",{className:"text-xl font-semibold mt-4",children:"Most Followed Program"}),(0,r.jsxs)("table",{className:"min-w-full bg-white border border-gray-200 shadow-md rounded-lg overflow-hidden mt-2",children:[(0,r.jsx)("thead",{className:"bg-gray-50",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-2 text-left text-gray-600",children:"Program Title"}),(0,r.jsx)("th",{className:"px-4 py-2 text-left text-gray-600",children:"Count"})]})}),(0,r.jsx)("tbody",{children:x.mostFollowedProgram.map(e=>(0,r.jsxs)("tr",{className:"border-t border-gray-200",children:[(0,r.jsx)("td",{className:"px-4 py-2",children:e.title}),(0,r.jsx)("td",{className:"px-4 py-2",children:e.count})]},e.programId))})]}),(0,r.jsx)("h3",{className:"text-xl font-semibold mt-4",children:"Most Active Users"}),(0,r.jsxs)("table",{className:"min-w-full bg-white border border-gray-200 shadow-md rounded-lg overflow-hidden mt-2",children:[(0,r.jsx)("thead",{className:"bg-gray-50",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-2 text-left text-gray-600",children:"Email"}),(0,r.jsx)("th",{className:"px-4 py-2 text-left text-gray-600",children:"First Name"}),(0,r.jsx)("th",{className:"px-4 py-2 text-left text-gray-600",children:"Last Name"}),(0,r.jsx)("th",{className:"px-4 py-2 text-left text-gray-600",children:"Workouts Done"})]})}),(0,r.jsx)("tbody",{children:x.mostActiveUser.map(e=>(0,r.jsxs)("tr",{className:"border-t border-gray-200",children:[(0,r.jsx)("td",{className:"px-4 py-2",children:e.email}),(0,r.jsx)("td",{className:"px-4 py-2",children:e.firstName}),(0,r.jsx)("td",{className:"px-4 py-2",children:e.lastName}),(0,r.jsx)("td",{className:"px-4 py-2",children:e.workoutsDone})]},e.userId))})]}),(0,r.jsx)("h3",{className:"text-xl font-semibold mt-4",children:"Most Popular Workouts"}),(0,r.jsxs)("table",{className:"min-w-full bg-white border border-gray-200 shadow-md rounded-lg overflow-hidden mt-2",children:[(0,r.jsx)("thead",{className:"bg-gray-50",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-4 py-2 text-left text-gray-600",children:"Workout ID"}),(0,r.jsx)("th",{className:"px-4 py-2 text-left text-gray-600",children:"Count"})]})}),(0,r.jsx)("tbody",{children:x.mostPopularWorkouts.map(e=>(0,r.jsxs)("tr",{className:"border-t border-gray-200",children:[(0,r.jsx)("td",{className:"px-4 py-2",children:e.title}),(0,r.jsx)("td",{className:"px-4 py-2",children:e.count})]},e.workoutId))})]}),(0,r.jsx)("h3",{className:"text-xl font-semibold mt-4",children:"Workout Sessions Per Day"}),(0,r.jsx)("div",{className:"bg-white border border-gray-200 shadow-md rounded-lg overflow-hidden mt-2 p-4",children:(0,r.jsx)(d.x1,{options:{responsive:!0,plugins:{legend:{position:"top"},title:{display:!0,text:"Workout Sessions Per Day"}}},data:N})})]})]})};var h=!0;t.default=x}},function(e){e.O(0,[4885,2196,9612,8764,2729,6325,8593,9774,2888,179],function(){return e(e.s=31890)}),_N_E=e.O()}]);

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.