import{u as o,t as p,r as u,j as e,n as s,L as j,a as y}from"./index-B-YXshIJ.js";const b=()=>{var l;const a=o(),r=p.analytics.getAnalyticsGroups.useQuery();return u.useEffect(()=>{a({title:"Analytics"})},[a]),e.jsx("div",{className:"mx-32 bg-gray-50 p-8 rounded-lg",style:{marginTop:"-3.25rem"},children:r?e.jsx("ul",{className:"grid grid-flow-row gap-8 grid-col-1 grid-cols-2 auto-rows-auto",children:(l=r.data)==null?void 0:l.map(({label:i,pageViews:x,uniques:d,pages:c,returning:n})=>e.jsxs("li",{className:"border-2 border-gray-200 rounded-xl overflow-hidden",children:[e.jsx("h2",{className:"text-2xl mb-2 bg-gray-900 text-white py-4 px-6 shadow-sm",children:i}),e.jsxs("div",{className:"flex flex-row gap-4 p-4",children:[e.jsxs("div",{className:"text-2xl bg-gray-200 rounded-md p-2 px-3",children:[s(x),e.jsx("div",{className:"text-sm text-gray-600",children:"Page views"})]}),e.jsxs("div",{className:"text-2xl bg-gray-200 rounded-md p-2 px-3",children:[s(d),e.jsx("div",{className:"text-sm text-gray-600",children:"Unique visitors"})]}),e.jsxs("div",{className:"text-2xl bg-gray-200 rounded-md p-2 px-3",children:[s(n),e.jsx("div",{className:"text-sm text-gray-600",children:"Returning visitors"})]})]}),e.jsxs("table",{className:"m-4 break-all",style:{width:"calc(100% - 2rem)"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{"aria-label":"Page URL",children:"&nbsp"}),e.jsx("th",{className:"font-light text-xs uppercase text-right pr-3",children:"Views"}),e.jsx("th",{className:"font-light text-xs uppercase text-right pr-3",children:"Uniques"})]})}),e.jsx("tbody",{children:c.map(({path:t,pageViews:m,uniques:g},h)=>e.jsxs("tr",{className:h%2===0?"":"bg-gray-200",children:[e.jsx("td",{className:"p-1 px-3",width:"75%",children:e.jsx(j,{to:t,className:"text-blue-600 hover:text-blue-800 inline-block text-sm truncate w-96",title:t,children:t})}),e.jsx("td",{className:"p-1 px-3 text-right align-top text-sm text-gray-700",width:"10%",children:s(m)}),e.jsx("td",{className:"p-1 px-3 text-right align-top text-sm text-gray-700",width:"10%",children:s(g)})]},t))})]})]},i))}):e.jsx(y,{})})};export{b as default};
