harshapitla/stackoverflow
0
1"use strict";(self.webpackChunkreact_template=self.webpackChunkreact_template||[]).push([[715],{4715:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});var s=a(5043),i=a(579);function l(e){let{icon:t,title:a,value:s,subtitle:l,accent:n}=e;return(0,i.jsxs)("div",{className:"kpi-card ".concat(n||""),children:[(0,i.jsxs)("div",{className:"kpi-header",children:[(0,i.jsx)("span",{className:"kpi-icon",children:t}),(0,i.jsx)("span",{className:"kpi-title",children:a})]}),(0,i.jsx)("div",{className:"kpi-value",children:s}),l&&(0,i.jsx)("div",{className:"kpi-sub",children:l})]})}function n(e){let{rows:t=[]}=e;const a=(0,s.useMemo)(()=>{if(!t.length)return null;let e=0,a=0,s=0,i=0,l=0,n=0;const o=new Set;return t.forEach(t=>{e+=t.followers_count||0,a+=t.reviews_count||0,s+=t.used_by_count||0,i+=t.awards_count||0,t.rating_average&&t.rating_average>0&&(l+=t.rating_average,n+=1),t.categories&&String(t.categories).replace(/[\[\]"]/g,"").split(",").map(e=>e.trim()).filter(Boolean).forEach(e=>o.add(e))}),{totalProducts:t.length,totalFollowers:e,totalReviews:a,totalUsage:s,totalAwards:i,avgFollowers:e/t.length,avgReviews:a/t.length,avgUsage:s/t.length,avgRating:n?l/n:0,ratingCoverage:n/t.length*100,uniqueCategories:o.size}},[t]);return a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"snapshot-banner",children:[(0,i.jsx)("strong",{children:"Data snapshot"})," \u2014 based on Product Hunt marketplace data"]}),(0,i.jsxs)("div",{className:"kpi-grid",children:[(0,i.jsx)(l,{icon:"\ud83d\udce6",title:"Total Products",value:a.totalProducts.toLocaleString()}),(0,i.jsx)(l,{icon:"\ud83d\udc65",title:"Total Followers",value:a.totalFollowers.toLocaleString()}),(0,i.jsx)(l,{icon:"\ud83d\udcdd",title:"Total Reviews",value:a.totalReviews.toLocaleString()}),(0,i.jsx)(l,{icon:"\ud83d\ude80",title:"Total Users",value:a.totalUsage.toLocaleString()}),(0,i.jsx)(l,{icon:"\ud83c\udfc5",title:"Total Awards",value:a.totalAwards.toLocaleString()}),(0,i.jsx)(l,{icon:"\u2b50",title:"Avg Rating",value:a.avgRating.toFixed(1),subtitle:"".concat(a.ratingCoverage.toFixed(1),"% products rated")}),(0,i.jsx)(l,{icon:"\ud83d\udcca",title:"Avg Followers",value:a.avgFollowers.toFixed(0),subtitle:"Per product"}),(0,i.jsx)(l,{icon:"\ud83d\udcac",title:"Avg Reviews",value:a.avgReviews.toFixed(1),subtitle:"Per product"}),(0,i.jsx)(l,{icon:"\ud83d\udc64",title:"Avg Usage",value:a.avgUsage.toFixed(1),subtitle:"Active users"}),(0,i.jsx)(l,{icon:"\ud83e\udde9",title:"Categories",value:a.uniqueCategories,subtitle:"Unique segments"})]}),(0,i.jsxs)("div",{className:"insights-box",children:[(0,i.jsx)("strong",{children:"Key Insights"}),(0,i.jsxs)("ul",{children:[(0,i.jsxs)("li",{children:["The dataset contains"," ",(0,i.jsx)("strong",{children:a.totalProducts.toLocaleString()})," products, showing a diverse and competitive Product Hunt ecosystem."]}),(0,i.jsx)("li",{children:"While many products attract followers, the average usage remains significantly lower, highlighting a gap between visibility and real adoption."}),(0,i.jsxs)("li",{children:["A strong average rating of"," ",(0,i.jsx)("strong",{children:a.avgRating.toFixed(1)})," indicates generally positive product quality across categories."]}),(0,i.jsxs)("li",{children:["The presence of ",(0,i.jsx)("strong",{children:a.uniqueCategories})," unique categories reflects a well-distributed innovation landscape rather than dominance by a single segment."]})]})]})]}):null}}}]);2//# sourceMappingURL=715.43666f3e.chunk.js.map