1import{j as e}from"./ui-vendor-CealJQWJ.js";import{r as o}from"./react-vendor-BkH0-HFx.js";import{supabase as j}from"./client-D7ttkOWR.js";import{C as N}from"./chart-column-atJXw5WN.js";import"./index-BKQfK9e1.js";import"./query-vendor-i3MONKX8.js";const v={A:"Wirtschafts- und Politik News",B:"Felix persönlich",C:"Tipps für Selbstständige und Unternehmer",D:"News zu Investments, Beteiligungen und Immobilien"},w={A:"Kundengewinnung",B:"Skalierung",C:"Gründung"},E=()=>{const[i,m]=o.useState([]),[u,x]=o.useState(!0);o.useEffect(()=>{(async()=>{const{data:t,error:r}=await j.from("newsletter_poll_votes").select("main_choice,sub_choice");!r&&t&&m(t),x(!1)})()},[]);const a=i.length,c={};i.forEach(s=>{c[s.main_choice]=(c[s.main_choice]||0)+1});const n={};i.filter(s=>s.main_choice==="C"&&s.sub_choice).forEach(s=>{n[s.sub_choice]=(n[s.sub_choice]||0)+1});const d=["A","B","C","D"],l=["A","B","C"],h=Math.max(...d.map(s=>c[s]||0),1),p=Math.max(...l.map(s=>n[s]||0),1);return u?e.jsx("div",{className:"min-h-screen bg-background text-foreground flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin"})}):e.jsx("div",{className:"min-h-screen bg-background text-foreground px-4 py-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto space-y-10",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx(N,{className:"h-10 w-10 mx-auto text-[hsl(104,46%,48%)]"}),e.jsx("h1",{className:"font-['Anton'] uppercase text-3xl md:text-4xl tracking-wide",children:"Umfrage-Auswertung"}),e.jsxs("p",{className:"text-muted-foreground font-body",children:[a," ",a===1?"Stimme":"Stimmen"," bisher"]})]}),e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-6 md:p-8 space-y-6",children:[e.jsx("h2",{className:"font-['Anton'] uppercase text-xl md:text-2xl tracking-wide",children:"Welcher Content interessiert dich am meisten?"}),e.jsx("div",{className:"space-y-4",children:d.map(s=>{const t=c[s]||0,r=a>0?Math.round(t/a*100):0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm font-body",children:[e.jsxs("span",{className:"text-foreground",children:[s," â ",v[s]]}),e.jsxs("span",{className:"text-muted-foreground",children:[t," (",r,"%)"]})]}),e.jsx("div",{className:"h-4 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[hsl(104,46%,48%)] rounded-full transition-all duration-500",style:{width:`${t/h*100}%`}})})]},s)})})]}),(n.A||n.B||n.C)&&e.jsxs("div",{className:"bg-card border border-border rounded-2xl p-6 md:p-8 space-y-6",children:[e.jsx("h2",{className:"font-['Anton'] uppercase text-xl md:text-2xl tracking-wide",children:'Was genau interessiert dich bei "Tipps für Selbstständige"?'}),e.jsx("div",{className:"space-y-4",children:l.map(s=>{const t=n[s]||0,r=Object.values(n).reduce((b,g)=>b+g,0),f=r>0?Math.round(t/r*100):0;return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-sm font-body",children:[e.jsxs("span",{className:"text-foreground",children:[s," â ",w[s]]}),e.jsxs("span",{className:"text-muted-foreground",children:[t," (",f,"%)"]})]}),e.jsx("div",{className:"h-4 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-[hsl(104,46%,48%)] rounded-full transition-all duration-500",style:{width:`${t/p*100}%`}})})]},s)})})]})]})})};export{E 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.