PageSourceSearch

https://utwpolska.pl/assets/ZakupSukces-PJhoYF_k.js

js utwpolska.pl collected 2026-10-06 12:54:45 UTC 3,429 bytes, 1 lines download raw bytes

1import{u as h,r as n,j as e,S as y,m as b,q as g,e as k,A as z}from"./index-BPOcIo0n.js";import{C as w}from"./check-circle-2-CYKplh2T.js";import{L as N}from"./loader-2-B_lF0O8s.js";function T(){const[u]=h(),s=u.get("session_id")||"",[a,x]=n.useState(null),[o,c]=n.useState(null),[p,f]=n.useState(0);n.useEffect(()=>{if(!s){c("Brak identyfikatora sesji.");return}let i=!1,r=0;const l=async()=>{r+=1,f(r);try{const m=await fetch(`/api/ebooks/order-status?session_id=${encodeURIComponent(s)}`);if(m.ok){const d=await m.json();if(!i){if(x(d),d.status==="fulfilled"||r>=20)return;setTimeout(l,3e3)}}else m.status===404&&r<20?setTimeout(l,3e3):i||c("Nie udało się sprawdzić statusu zamówienia.")}catch{!i&&r<20&&setTimeout(l,3e3)}};return l(),()=>{i=!0}},[s]);const t=(a==null?void 0:a.status)==="fulfilled",j=!t&&!o;return e.jsxs("div",{className:"bg-surface min-h-screen pt-32 pb-24 flex items-center justify-center",children:[e.jsx(y,{title:"Dziękujemy za zakup | UTW APS",description:"Potwierdzenie zakupu e-booka.",canonicalPath:"/zakup/sukces",robots:"noindex,follow"}),e.jsx("div",{className:"container mx-auto px-6 max-w-xl text-center",children:e.jsxs(b.div,{initial:!1,animate:{scale:1,opacity:1},className:"bg-white rounded-[3rem] p-12 shadow-2xl border border-green-100",children:[e.jsx("div",{className:`w-24 h-24 rounded-full flex items-center justify-center mx-auto mb-8 ${t?"bg-green-100 text-green-600":"bg-amber-100 text-amber-600"}`,children:t?e.jsx(w,{className:"w-12 h-12"}):e.jsx(N,{className:"w-12 h-12 animate-spin"})}),e.jsx("h1",{className:"text-4xl font-bold text-primary mb-4",children:t?"Dziękujemy za zakup!":"Przyjęliśmy płatność…"}),t&&a?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xl text-primary/70 font-medium mb-6 leading-relaxed",children:["Wysłaliśmy ebook na adres ",e.jsx("strong",{className:"text-primary",children:a.buyer_email}),"."]}),e.jsx("p",{className:"text-primary/55 font-medium mb-8 leading-relaxed",children:'W mailu znajdziesz link do pobrania pliku oraz fakturę w załączniku. Sprawdź skrzynkę (także folder „Promocje" / „Spam").'})]}):null,j?e.jsxs("p",{className:"text-primary/70 font-medium mb-8 leading-relaxed",children:["Przygotowujemy fakturę i wysyłamy ebook na maila. Zwykle trwa to kilkanaście sekund. Strona odświeży się automatycznie.",p>5?" (To zajmuje dłużej niż zwykle — zostań chwilę dłużej.)":""]}):null,o?e.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-2xl p-6 text-red-700 font-medium mb-8",children:[o,e.jsx("br",{}),"Skontaktuj się z nami: ",e.jsx("a",{className:"underline",href:"mailto:[email protected]",children:"[email protected]"})]}):null,e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[e.jsxs("a",{href:"mailto:[email protected]",className:"inline-flex items-center justify-center gap-2 bg-surface text-primary px-6 py-3 rounded-xl font-bold border border-primary/10 hover:bg-white transition-all",children:[e.jsx(g,{className:"w-4 h-4"})," Napisz do nas"]}),e.jsxs(k,{to:"/",className:"inline-flex items-center justify-center gap-2 bg-primary text-white px-6 py-3 rounded-xl font-bold hover:bg-primary-light transition-all shadow-lg",children:["Strona główna ",e.jsx(z,{className:"w-4 h-4"})]})]}),s?e.jsxs("p",{className:"text-primary/40 text-xs font-medium mt-6",children:["ID sesji: ",s]}):null]})})]})}export{T as ZakupSukces};

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.