PageSourceSearch

https://loveacrossborders.com/assets/admin.orders-CfqnsN_C.js

js loveacrossborders.com collected 2026-10-08 14:16:38 UTC 2,691 bytes, 1 lines download raw bytes

1import{j as e,n as m}from"./index-hs4a0mYW.js";import{u as c}from"./useQuery-C-iGd3mh.js";import{u as l}from"./useServerFn-DgMZqDJQ.js";import{A as o}from"./SiteHeader-BqOOKgqK.js";import{A as x}from"./AdminGate-Db1E1sSR.js";import"./useMutation-CsVV5qgy.js";import"./books.functions-BjM2fbuH.js";function b(){return e.jsx(x,{active:"orders",children:e.jsx(u,{})})}function u(){const a=l(m),{data:s,isLoading:d,error:n}=c({queryKey:["admin","orders"],queryFn:()=>a(),retry:!1}),i=(s??[]).filter(t=>t.status==="paid").reduce((t,r)=>t+(r.total_cents??0),0);return e.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[e.jsx(o,{active:"orders"}),e.jsxs("main",{className:"mx-auto max-w-6xl px-6 sm:px-8 py-12",children:[e.jsxs("div",{className:"flex items-baseline justify-between flex-wrap gap-4",children:[e.jsx("h1",{className:"font-serif text-primary",style:{fontSize:"2rem"},children:"Orders"}),e.jsxs("div",{className:"text-sm text-foreground/80",children:["Paid revenue: ",e.jsxs("strong",{className:"text-accent",children:["$",(i/100).toFixed(2)]})]})]}),d?e.jsx("p",{className:"mt-8 text-muted-foreground",children:"Loading…"}):n?e.jsx("p",{className:"mt-8 text-destructive",children:"You need admin access to view this page."}):!s||s.length===0?e.jsx("p",{className:"mt-8 text-muted-foreground",children:"No orders yet."}):e.jsx("div",{className:"mt-8 overflow-hidden rounded bg-card border border-border",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Date"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Email"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Items"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium",children:"Status"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Total"})]})}),e.jsx("tbody",{children:s.map(t=>e.jsxs("tr",{className:"border-t border-border",children:[e.jsx("td",{className:"px-4 py-3 text-foreground/80",children:new Date(t.created_at).toLocaleString()}),e.jsx("td",{className:"px-4 py-3",children:t.email}),e.jsx("td",{className:"px-4 py-3 text-foreground/80",children:(t.order_items??[]).map(r=>`${r.title_snapshot} ×${r.quantity}`).join(", ")||"(none)"}),e.jsx("td",{className:"px-4 py-3 text-center",children:e.jsx("span",{className:t.status==="paid"?"text-accent":"text-muted-foreground",children:t.status})}),e.jsxs("td",{className:"px-4 py-3 text-right",children:["$",((t.total_cents??0)/100).toFixed(2)," ",t.currency]})]},t.id))})]})})]})]})}export{b 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.