PageSourceSearch

https://vorne.media/assets/smm.leads-DmajwXvN.js

js vorne.media collected 2026-10-09 22:01:48 UTC 5,637 bytes, 1 lines download raw bytes

1import{c as u,r as a,j as e}from"./main-B4YJ8qww.js";const w=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],N=u("download",w);const S=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],T=u("lock",S),x="smm_admin_token",E="d70c2f208b67797d96a873744d476c6919b6";function L(t){try{return new Date(t).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return t}}function C(){const[t,i]=a.useState(E),[r,m]=a.useState(""),[o,c]=a.useState([]),[p,f]=a.useState(!1),[y,d]=a.useState("");a.useEffect(()=>{const s=localStorage.getItem(x);s&&(i(s),m(s))},[]);async function v(s){f(!0),d("");try{const n=await fetch(`/api/public/smm-leads?token=${encodeURIComponent(s)}`,{headers:{"x-admin-token":s}});if(n.status===401){d("Token ungültig."),c([]);return}if(!n.ok){d("Laden fehlgeschlagen.");return}const l=await n.json();c(l.leads??[])}catch{d("Netzwerkfehler.")}finally{f(!1)}}a.useEffect(()=>{r&&v(r)},[r]);function j(){localStorage.setItem(x,t),m(t)}function b(){localStorage.removeItem(x),i(""),m(""),c([])}const h=a.useMemo(()=>{const s=o.filter(l=>l.opt_in).length,n=new Set(o.map(l=>l.company).filter(Boolean)).size;return{total:o.length,optIn:s,companies:n}},[o]),k=r?`/api/public/smm-leads?token=${encodeURIComponent(r)}&format=csv`:"#";return r?e.jsx("div",{className:"smm-root",style:{background:"var(--smm-bg)",color:"var(--smm-fg)",minHeight:"100vh"},children:e.jsx("section",{className:"smm-section",children:e.jsxs("div",{className:"smm-container",children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"smm-eyebrow",children:"SMM Hamburg · Leads"}),e.jsx("h1",{className:"smm-h2",style:{marginTop:12},children:"Einsammelte Kontakte"})]}),e.jsxs("div",{style:{display:"flex",gap:8},children:[e.jsxs("a",{className:"smm-btn",href:k,children:[e.jsx(N,{style:{width:16,height:16}})," CSV"]}),e.jsx("button",{className:"smm-btn",onClick:b,style:{background:"transparent",border:"1px solid var(--smm-border)"},children:"Abmelden"})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(140px,1fr))",gap:12,marginTop:28},children:[e.jsx(g,{label:"Leads gesamt",value:h.total}),e.jsx(g,{label:"Opt-in",value:h.optIn}),e.jsx(g,{label:"Unternehmen",value:h.companies})]}),y&&e.jsx("p",{style:{marginTop:24,color:"#FF9A9A"},children:y}),e.jsx("div",{style:{marginTop:28,overflowX:"auto",border:"1px solid var(--smm-border)",borderRadius:16},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14,minWidth:720},children:[e.jsx("thead",{children:e.jsx("tr",{style:{textAlign:"left"},children:["Datum","Name","E-Mail","Telefon","Unternehmen","Opt-in"].map(s=>e.jsx("th",{style:{padding:"14px 16px",borderBottom:"1px solid var(--smm-border)",color:"var(--smm-fg2)",fontWeight:600},children:s},s))})}),e.jsxs("tbody",{children:[p&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,style:{padding:24,color:"var(--smm-fg2)"},children:"Lade…"})}),!p&&o.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,style:{padding:24,color:"var(--smm-fg2)"},children:"Noch keine Leads."})}),!p&&o.map((s,n)=>e.jsxs("tr",{style:{borderTop:n===0?"none":"1px solid var(--smm-border)"},children:[e.jsx("td",{style:{padding:"12px 16px",color:"var(--smm-fg2)",whiteSpace:"nowrap"},children:L(s.created_at)}),e.jsxs("td",{style:{padding:"12px 16px"},children:[s.first_name," ",s.last_name]}),e.jsx("td",{style:{padding:"12px 16px"},children:e.jsx("a",{className:"smm-link",href:`mailto:${s.email}`,children:s.email})}),e.jsx("td",{style:{padding:"12px 16px",whiteSpace:"nowrap"},children:s.phone?e.jsx("a",{className:"smm-link",href:`tel:${s.phone}`,children:s.phone}):"—"}),e.jsx("td",{style:{padding:"12px 16px",color:"var(--smm-fg2)"},children:s.company||"—"}),e.jsx("td",{style:{padding:"12px 16px"},children:s.opt_in?e.jsx("span",{style:{color:"#B9E0A0"},children:"ja"}):e.jsx("span",{style:{color:"var(--smm-fg2)"},children:"nein"})})]},n))]})]})})]})})}):e.jsx("div",{className:"smm-root",style:{background:"var(--smm-bg)",color:"var(--smm-fg)",minHeight:"100vh"},children:e.jsx("section",{className:"smm-section",children:e.jsxs("div",{className:"smm-container",style:{maxWidth:460},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[e.jsx(T,{style:{width:16,height:16}}),e.jsx("span",{className:"smm-eyebrow",children:"Geschützt"})]}),e.jsx("h1",{className:"smm-h2",style:{marginTop:16},children:"SMM Leads"}),e.jsx("p",{style:{marginTop:12,color:"var(--smm-fg2)",fontSize:15,lineHeight:1.6}
1,children:"Gib den Admin-Token ein, um die eingesammelten Messe-Contacts zu sehen."}),e.jsxs("div",{style:{display:"flex",gap:8,marginTop:24},children:[e.jsx("input",{className:"smm-input",type:"password",value:t,onChange:s=>i(s.target.value),onKeyDown:s=>s.key==="Enter"&&j(),placeholder:"Admin-Token",style:{background:"var(--smm-surface)",borderColor:"var(--smm-border)",color:"var(--smm-fg)"}}),e.jsx("button",{className:"smm-btn smm-btn-primary",onClick:j,disabled:!t,children:"Öffnen"})]})]})})})}function g({label:t,value:i}){return e.jsxs("div",{className:"smm-tile",style:{padding:18},children:[e.jsx("div",{className:"smm-mono",style:{color:"var(--smm-fg2)"},children:t}),e.jsx("div",{style:{fontSize:32,fontWeight:800,letterSpacing:"-0.02em",marginTop:6},children:i})]})}export{C as component};

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.