PageSourceSearch

https://mahmoudmasri.com/assets/AdminEmailSubscribers-CG_NJi34.js

js mahmoudmasri.com collected 2026-09-30 08:26:49 UTC 2,193 bytes, 1 lines download raw bytes

1import{r as d,j as e}from"./ui-BgAZunKE.js";import{a as m,b as x,e as u}from"./useEmailCapture-Cch1vlhV.js";import{ah as h,I as p,G as f,a1 as j,as as g,J as n}from"./index-CD3Ytjl1.js";import"./supabase-Cv5z-ElN.js";import"./query-DfKp04n6.js";import"./vendor-BPxC6GVa.js";const C=()=>{const{data:t=[],isLoading:c}=m(),l=x(),[a,i]=d.useState(""),r=t.filter(s=>s.email.toLowerCase().includes(a.toLowerCase())||(s.name||"").toLowerCase().includes(a.toLowerCase())),o=async s=>{if(confirm("هل تريد حذف هذا المشترك؟"))try{await l.mutateAsync(s),n.success("تم الحذف")}catch{n.error("خطأ في الحذف")}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[200px]",children:[e.jsx(h,{className:"absolute right-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(p,{placeholder:"بحث...",value:a,onChange:s=>i(s.target.value),className:"bg-muted/50 pr-9"})]}),e.jsxs(f,{onClick:()=>u(t),size:"sm",variant:"outline",className:"gap-2",disabled:t.length===0,children:[e.jsx(j,{className:"w-4 h-4"})," تصدير CSV"]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[t.length," مشترك"]}),c?e.jsx("p",{className:"text-muted-foreground text-center py-8",children:"جاري التحميل..."}):r.length===0?e.jsx("p",{className:"text-muted-foreground text-center py-8",children:"لا يوجد مشتركين"}):e.jsx("div",{className:"space-y-2",children:r.map(s=>e.jsxs("div",{className:"glass-card rounded-xl p-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-foreground truncate",dir:"ltr",children:s.email}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground mt-0.5",children:[s.name&&e.jsx("span",{children:s.name}),e.jsx("span",{children:new Date(s.created_at).toLocaleDateString("ar-EG")})]})]}),e.jsx("button",{onClick:()=>
1o(s.id),className:"text-muted-foreground hover:text-destructive flex-shrink-0",children:e.jsx(g,{className:"w-4 h-4"})})]},s.id))})]})};export{C 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.