PageSourceSearch

https://www.anagram.world/assets/BookingsList-BFVHxQuH.js

js anagram.world collected 2026-10-09 21:27:14 UTC 2,464 bytes, 1 lines download raw bytes

1import{r as a,j as e}from"./react-DlBquRhq.js";import{s as h}from"./index-CVeKy3HG.js";import{c as n,t as m}from"./theme-DpdrwuOw.js";import"./Select-DEo2NNmK.js";import{P as p}from"./Pill-BJH7jFXq.js";import{T as x,a as f,b as l,c as i,d as j,e as o}from"./Table-Bk3mIn9C.js";import{E as g}from"./EmptyState-DtB-HTut.js";import{P as y}from"./PageHeader-CJBBT1Jp.js";import{L as k}from"./Spinner-DamV4FPX.js";import"./supabase-CpRTRdvQ.js";import"./animation-B0WpSdC-.js";function T(t,s){try{return new Intl.NumberFormat("en-GB",{style:"currency",currency:s}).format(t/100)}catch{return`${(t/100).toFixed(2)} ${s}`}}function v(t){const s=(t??"").toLowerCase();return["confirmed","checked_in","checked-in","paid"].includes(s)?"success":["pending","processing"].includes(s)?"warn":["cancelled","canceled","failed","refunded"].includes(s)?"error":"neutral"}function N(){const[t,s]=a.useState([]),[c,d]=a.useState(!0);return a.useEffect(()=>{let r=!1;return h.from("bookings").select("*").order("created_at",{ascending:!1}).limit(100).then(({data:u})=>{r||(s(u??[]),d(!1))}),()=>{r=!0}},[]),e.jsxs("div",{children:[e.jsx(y,{title:"Bookings",description:c?void 0:`Showing the most recent ${t.length} reservation${t.length===1?"":"s"}.`}),c?e.jsx(k,{}):t.length===0?e.jsx(g,{title:"No bookings yet",description:"Reservations appear here once Apaleo syncs them."}):e.jsxs(x,{children:[e.jsx(f,{children:e.jsxs(l,{children:[e.jsx(i,{children:"Reference"}),e.jsx(i,{children:"Guest"}),e.jsx(i,{children:"Dates"}),e.jsx(i,{children:"Status"}),e.jsx(i,{style:{textAlign:"right"},children:"Total"})]})}),e.jsx(j,{children:t.map(r=>e.jsxs(l,{hoverable:!0,children:[e.jsx(o,{children:e.jsx("code",{style:{fontFamily:"'JetBrains Mono', ui-monospace, monospace",fontSize:12,color:n.dark},children:r.reference})}),e.jsxs(o,{children:[e.jsxs("div",{style:{color:n.dark,fontWeight:500},children:[r.guest_first_name," ",r.guest_last_name]}),e.jsx("div",{style:{...m.caption,color:n.text55,marginTop:2},children:r.guest_email})]}),e.jsxs(o,{children:[e.jsx("span",{style:{color:n.dark},children:r.arrival}),e.jsx("span",{style:{color:n.text40,margin:"0 6px"},children:"→"}),e.jsx("span",{style:{color:n.dark},children:r.departure})]}),e.jsx(o,{children:e.jsx(p,{tone:v(r.status),uppercase:!0,children:r.status??"—"})}),e.jsx(o,{style:{textAlign:"right",fontVariantNumeric:"tabular-nums",fontWeight:500},children:T(r.total_cents,r.currency)})]},r.id))})]})]})}export{N 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.