PageSourceSearch

https://geltoynation.com/assets/admin.subscribers-BMZRqE_e.js

js geltoynation.com collected 2026-10-04 02:39:57 UTC 3,496 bytes, 2 lines download raw bytes

1import{c as p,k as u,r,j as e,L as h,b}from"./index-BCW6nnV8.js";import{a as f}from"./subscribers.functions-D4_hwADD.js";import{I as j}from"./inbox-QqIqGKvq.js";const g=[["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"}]],y=p("download",g);function N(n){const t=["email","created_at","campaign","source","coupon_code","coupon_status","shopify_sync_status","marketing_consent"],c=a=>`"${String(a??"").replace(/"/g,'""')}"`;return[t.join(","),...n.map(a=>t.map(o=>c(a[o])).join(","))].join(`
2`)}function _(){const n=u(f),[t,c]=r.useState([]),[a,o]=r.useState(!0),[l,x]=r.useState(!1);r.useEffect(()=>{(async()=>{try{const s=await n({});c(s.subscribers)}catch(s){String(s?.message||"").toLowerCase().includes("forbidden")?x(!0):console.error(s)}finally{o(!1)}})()},[n]);function m(){const s=new Blob([N(t)],{type:"text/csv;charset=utf-8"}),d=URL.createObjectURL(s),i=document.createElement("a");i.href=d,i.download=`email-subscribers-${new Date().toISOString().slice(0,10)}.csv`,i.click(),URL.revokeObjectURL(d)}return e.jsx("div",{className:"min-h-screen bg-background px-4 py-10",children:e.jsxs("div",{className:"mx-auto max-w-6xl",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("h1",{className:"font-display text-3xl font-extrabold italic uppercase",children:"Email Subscribers"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{to:"/admin/reviews",className:"text-sm text-foreground/60 hover:text-brand",children:"Reviews"}),e.jsxs("button",{onClick:m,disabled:!t.length,className:"inline-flex items-center gap-2 rounded-lg bg-brand px-4 py-2 text-sm font-bold uppercase text-brand-foreground disabled:opacity-50",children:[e.jsx(y,{className:"h-4 w-4"})," Export CSV"]})]})]}),a?e.jsx("div",{className:"mt-16 flex justify-center",children:e.jsx(b,{className:"h-6 w-6 animate-spin text-brand"})}):l?e.jsx("p",{className:"mt-10 text-foreground/70",children:"Admin access required."}):t.length===0?e.jsxs("div",{className:"mt-16 text-center text-foreground/60",children:[e.jsx(j,{className:"mx-auto h-8 w-8"}),e.jsx("p",{className:"mt-3",children:"No subscribers yet."})]}):e.jsx("div",{className:"mt-6 overflow-x-auto rounded-xl border border-border",children:e.jsxs("table",{className:"w-full min-w-[720px] text-sm",children:[e.jsx("thead",{className:"bg-surface text-left text-xs uppercase tracking-wide text-foreground/60",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3",children:"Email"}),e.jsx("th",{className:"px-4 py-3",children:"Date joined"}),e.jsx("th",{className:"px-4 py-3",children:"Campaign"}),e.jsx("th",{className:"px-4 py-3",children:"Coupon code"}),e.jsx("th",{className:"px-4 py-3",children:"Status"}),e.jsx("th",{className:"px-4 py-3",children:"Shopify sync"})]})}),e.jsx("tbody",{children:t.map(s=>e.jsxs("tr",{className:"border-t border-border/60",children:[e.jsx("td",{className:"px-4 py-3",children:s.email}),e.jsx("td",{className:"px-4 py-3 text-foreground/70",children:new Date(s.created_at).toLocaleString()}),e.jsx("td",{className:"px-4 py-3 text-foreground/70",children:s.campaign}),e.jsx("td",{className:"px-4 py-3 font-mono text-brand",children:s.coupon_code}),e.jsx("td",{className:"px-4 py-3 text-foreground/70",children:s.coupon_status}),e.jsx("td",{className:"px-4 py-3 text-foreground/70",children:s.shopify_sync_status})]},s.id))})]})})]})})}export{_ 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.