PageSourceSearch

https://herpowerapp.com/assets/AdminWeeklyFeedback-BbohBDXa.js

js herpowerapp.com collected 2026-10-09 22:04:12 UTC 8,835 bytes, 4 lines download raw bytes

1import{u as y,K as k,b as w,r as i,s as S,j as e,a2 as C,Q as E,R as F,U as T,h as m,V as A,C as n,ae as D,J as L,S as R,i as W}from"./index-DO0ZNUzu.js";import{A as I}from"./AdminNavigation-BALrVg_C.js";import"./bell-Dc_RYjMz.js";import"./chart-column-RBik8eZM.js";import"./settings-cLgs3mni.js";const O=()=>{y();const{isAdmin:c,loading:o}=k(),x=w(),[p,f]=i.useState(!0),[l,j]=i.useState([]),[d,g]=i.useState(1);i.useEffect(()=>{!o&&!c&&x("/admin/dashboard")},[c,o,x]),i.useEffect(()=>{c&&N()},[c]);const N=async()=>{try{const{data:a,error:s}=await S.from("weekly_beta_feedback").select(`
2          *,
3          profiles!inner(display_name, user_id)
4        `).order("created_at",{ascending:!1});if(s)throw s;const t=a==null?void 0:a.map(r=>({...r,profiles:{display_name:r.profiles.display_name,email:r.profiles.user_id}}));j(t||[])}catch(a){console.error("Error fetching weekly feedback:",a)}finally{f(!1)}};if(o||p)return e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-primary/20 via-accent/20 to-secondary/20 flex items-center justify-center",children:e.jsx(C,{})});if(!c)return null;const u=l.filter(a=>a.week_number===d),h=a=>{const s=l.filter(r=>r.week_number===d);return s.length===0?0:(s.reduce((r,_)=>r+(_[a]||0),0)/s.length).toFixed(1)},b=()=>{const a=l.filter(t=>t.week_number===d),s={};return a.forEach(t=>{t.circles_joined.forEach(r=>{s[r]=(s[r]||0)+1})}),Object.entries(s).sort(([,t],[,r])=>r-t).slice(0,3)},v=()=>{const a=l.filter(t=>t.week_number===d),s={};return a.forEach(t=>{t.features_used.forEach(r=>{s[r]=(s[r]||0)+1})}),Object.entries(s).sort(([,t],[,r])=>r-t).slice(0,3)};return e.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary/20 via-accent/20 to-secondary/20",children:[e.jsx(I,{}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-2",children:"Weekly Beta Feedback"}),e.jsx("p",{className:"text-muted-foreground",children:"Track beta user feedback and engagement over the 4-week program"})]}),e.jsxs(E,{value:d.toString(),onValueChange:a=>g(parseInt(a)),className:"mb-8",children:[e.jsx(F,{className:"flex w-full overflow-x-auto justify-start sm:grid sm:grid-cols-4",children:[1,2,3,4].map(a=>{const s=l.filter(t=>t.week_number===a).length;return e.jsxs(T,{value:a.toString(),children:["Week ",a,e.jsx(m,{variant:"secondary",className:"ml-2",children:s})]},a)})}),[1,2,3,4].map(a=>e.jsxs(A,{value:a.toString(),children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-6",children:[e.jsx(n,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"h-8 w-8 text-primary"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Submissions"}),e.jsx("p",{className:"text-2xl font-bold",children:l.filter(s=>s.week_number===a).length})]})]})}),e.jsx(n,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(L,{className:"h-8 w-8 text-green-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Avg Experience"}),e.jsxs("p",{className:"text-2xl font-bold",children:[h("overall_experience_rating"),"/10"]})]})]})}),e.jsx(n,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(R,{className:"h-8 w-8 text-yellow-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Recommend"}),e.jsxs("p",{className:"text-2xl font-bold",children:[h("would_recommend_rating"),"/10"]})]})]})}),e.jsx(n,{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(W,{className:"h-8 w-8 text-primary"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Completion"}),e.jsxs("p",{className:"text-2xl font-bold",children:[Math.round(l.filter(s=>s.week_number===a).length/100*100),"%"]})]})]})})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[e.jsxs(n,{className:"p-6",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Top Circles"}),e.jsx("div",{className:"space-y-3",children:b().map(([s,t],r)=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xl font-bold text-muted-foreground",children:r+1}),e.jsx("span",{className:"font-medium",children:s})]}),e.jsxs(m,{children:[t," users"]})]},s))})]}),e.jsxs(n,{className:"p-6",children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Top Features"}),e.jsx("div",{className:"space-y-3",children:v().map(([s,t],r)=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-2xl font-bold text-muted-foreground",children:r+1}),e.jsx("span",{className:"font-medium",children:s})]}),e.jsxs(m,{children:[t," users"]})]},s))})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-xl font-semibold",children:"Individual Submissions"}),u.length===0?e.jsx(n,{className:"p-8 text-center",children:e.jsxs("p",{className:"text-muted-foreground",children:["No feedback submissions for Week ",a," yet."]})}):u.map(s=>{var t;return e.jsx(n,{className:"p-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between pb-4 border-b",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-lg",children:((t=s.profiles)==null?void 0:t.display_name)||"Beta User"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Submitted ",new Date(s.created_at).toLocaleDateString()]})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-primary",children:s.overall_experience_rating}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Experience"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-primary",children:s.would_recommend_rating}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Recommend"})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Circle Engagement"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Joined:"})," ",s.circles_joined.join(", ")||"None"]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Favorite:"})," ",s.favorite_circle]}),s.favorite_circle_reason&&e.jsxs("p",{className:"text-muted-foreground italic",children:['"',s.favorite_circle_reason,'"']}
4),s.circle_improvement_suggestions&&e.jsxs("div",{className:"mt-2 p-3 bg-yellow-500/10 rounded-lg",children:[e.jsx("p",{className:"font-medium text-yellow-900",children:"Improvement Suggestions:"}),e.jsx("p",{className:"text-sm text-yellow-800 mt-1",children:s.circle_improvement_suggestions})]})]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold mb-2",children:"Feature Feedback"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-muted-foreground",children:"Used:"})," ",s.features_used.join(", ")||"None"]}),s.features_liked_most&&e.jsxs("div",{className:"p-3 bg-green-500/10 rounded-lg",children:[e.jsx("p",{className:"font-medium text-green-900",children:"Liked Most:"}),e.jsx("p",{className:"text-sm text-green-800 mt-1",children:s.features_liked_most})]}),s.features_need_improvement&&e.jsxs("div",{className:"p-3 bg-orange-500/10 rounded-lg",children:[e.jsx("p",{className:"font-medium text-orange-900",children:"Needs Improvement:"}),e.jsx("p",{className:"text-sm text-orange-800 mt-1",children:s.features_need_improvement})]})]})]}),(s.bugs_encountered||s.new_feature_requests)&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.bugs_encountered&&e.jsxs("div",{className:"p-3 bg-red-500/10 rounded-lg",children:[e.jsx("p",{className:"font-medium text-red-900",children:"Bugs Encountered:"}),e.jsx("p",{className:"text-sm text-red-800 mt-1",children:s.bugs_encountered})]}),s.new_feature_requests&&e.jsxs("div",{className:"p-3 bg-blue-500/10 rounded-lg",children:[e.jsx("p",{className:"font-medium text-blue-900",children:"Feature Requests:"}),e.jsx("p",{className:"text-sm text-blue-800 mt-1",children:s.new_feature_requests})]})]}),s.additional_feedback&&e.jsxs("div",{className:"p-3 bg-accent/20 rounded-lg",children:[e.jsx("p",{className:"font-medium",children:"Additional Feedback:"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:s.additional_feedback})]})]})},s.id)})]})]},a))]})]})]})};export{O 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.