PageSourceSearch

https://clickdz.ai/assets/DownloadsList-BOhvl87K.js

js clickdz.ai collected 2026-10-04 12:35:04 UTC 3,866 bytes, 1 lines download raw bytes

1import{d as w,j as e,m as b,P as k,k as C,l as D,a9 as E,s as x,$ as I}from"./App-Cg173DAt.js";import{r as a}from"./index-caxmlYbZ.js";import{C as u,b as f}from"./card-698OG_lS.js";import{D as q}from"./Dashboard-C6oZqtZ_.js";import{K as L}from"./key-BD0mSsKt.js";import{C as P}from"./copy-CQqhbZih.js";import{f as B}from"./format-wcA9gTUs.js";import"./index--RATyRBH.js";import"./index-DIE_uK0V.js";import"./i18nInstance-C81hCH34.js";import"./tabs-Cc1lUMSL.js";import"./index-DM_s-Ag8.js";import"./heart-AqZIJmW0.js";import"./refresh-cw-DgG-yFTe.js";import"./formatDistanceToNow-ukJeSM4z.js";import"./en-US-4RaJY4CL.js";import"./chevron-left-BUAk7QAt.js";const W=()=>{const{user:i}=w(),[o,h]=a.useState([]),[y,d]=a.useState(!0),[g,c]=a.useState(null);a.useEffect(()=>{if(!i)return;(async()=>{try{const{data:t,error:n}=await x.from("orders").select("id").eq("user_id",i.id).order("created_at",{ascending:!1}).limit(200);if(n)throw n;if(!t||t.length===0){d(!1);return}const N=t.map(s=>s.id),{data:v,error:l}=await x.from("order_items").select("*, products(name, category)").in("order_id",N).order("created_at",{ascending:!1}).limit(500);if(l)throw l;const _=(v||[]).map(s=>{var m,p;return{id:s.id,license_key:s.license_key,delivered_at:s.delivered_at,quantity:s.quantity,price_at_purchase:s.price_at_purchase,created_at:s.created_at,product_name:((m=s.products)==null?void 0:m.name)||"Unknown Product",product_category:((p=s.products)==null?void 0:p.category)||""}});h(_)}catch(t){console.error("Error fetching deliveries:",t)}finally{d(!1)}})()},[i]);const j=(r,t)=>{navigator.clipboard.writeText(t),c(r),setTimeout(()=>c(null),2e3),I({title:"Copied!",description:"License key copied to clipboard."})};return y?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"w-8 h-8 border-2 border-primary/30 border-t-primary rounded-full animate-spin"})}):o.length===0?e.jsxs(u,{className:"overflow-hidden",children:[e.jsx("div",{className:"h-1 bg-gradient-to-r from-primary/50 via-accent/50 to-secondary/50"}),e.jsxs(f,{className:"p-6 sm:p-8 text-center",children:[e.jsx(q,{className:"w-10 h-10 sm:w-12 sm:h-12 mx-auto text-muted-foreground mb-4"}),e.jsx("h3",{className:"font-semibold mb-2",children:"No deliveries yet"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Your delivered digital products and license keys will appear here."})]})]}):e.jsx("div",{className:"space-y-3",children:o.map((r,t)=>e.jsx(b.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:t*.05},children:e.jsx(u,{className:"overflow-hidden",children:e.jsxs(f,{className:"p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx(k,{className:"w-5 h-5 text-primary"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h4",{className:"font-medium text-sm truncate",children:r.product_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[B(new Date(r.created_at),"MMM d, yyyy")," • Qty: ",r.quantity]})]})]}),e.jsx(C,{className:r.delivered_at?"bg-emerald-500/20 text-emerald-400":"bg-amber-500/20 text-amber-400",children:r.delivered_at?"Delivered":"Pending"})]}),r.license_key&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 p-2 rounded-lg bg-muted/50 border border-border",children:[e.jsx(L,{className:"w-4 h-4 text-primary flex-shrink-0"}),e.jsx("code",{className:"text-xs flex-1 font-mono truncate",children:r.license_key}),e.jsx(D,{size:"sm",variant:"ghost",className:"h-7 px-2",onClick:()=>j(r.id,r.license_key),children:g===r.id?e.jsx(E,{className:"w-3 h-3 text-emerald-500"}):e.jsx(P,{className:"w-3 h-3"})})]})]})})},r.id))})};export{W as DownloadsList};

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.