PageSourceSearch

https://royaldoors.co.uk/assets/QuotePage-cHeUZC7Y.js

js royaldoors.co.uk collected 2026-10-04 08:44:27 UTC 8,190 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-vendor-DuqeynD1.js";import{d as y,B as i}from"./index-D6hryE5F.js";import{a as w}from"./query-vendor-DND6ZGMt.js";import{P as c}from"./PublicLayout-Ce_YdSmf.js";import{C as x,a as u,b as v,c as b}from"./card-G9Q-B1n4.js";import{B as r}from"./badge-C2VHwMzo.js";import{S as C}from"./separator-Cvzrl5-B.js";import{i as D,o as k,r as E,D as I}from"./icons-DC9PkIwp.js";import{f as o}from"./format-CjnoOsBn.js";import"./react-vendor-Bzgz95E1.js";import"./siteNavigation-DFnjV5BW.js";import"./dropdown-menu-CmP7s5y8.js";import"./GoogleIcon-A6ncl4ml.js";import"./en-US-BddybvhD.js";function L(){const{reference:n}=y(),l=new URLSearchParams(window.location.search).get("key"),d=l?`?key=${encodeURIComponent(l)}`:"",{data:a,isLoading:h,error:f}=w({queryKey:["quote",n,l],queryFn:async()=>{const t=await fetch(`/api/quotes/${encodeURIComponent(n||"")}${d}`,{credentials:"include"});if(!t.ok)throw t.status===404?new Error("404: Quote not found"):new Error(`${t.status}: Failed to load quote`);return t.json()},enabled:!!n});if(h)return e.jsx(c,{children:e.jsx("div",{className:"container mx-auto px-4 py-16 flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"animate-pulse text-gray-500",children:"Loading quote..."})})});if(f||!a)return e.jsx(c,{children:e.jsx("div",{className:"container mx-auto px-4 py-16 flex items-center justify-center min-h-[60vh]",children:e.jsx(x,{className:"w-full max-w-md",children:e.jsxs(u,{className:"py-12 text-center",children:[e.jsx(D,{className:"h-12 w-12 text-red-500 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Quote Not Available"}),e.jsxs("p",{className:"text-gray-500",children:['This link to quote "',n,'" is no longer valid. Sign in to your account to see your quotes, or contact us for a new link.']}),e.jsxs("div",{className:"mt-6 flex flex-wrap justify-center gap-3",children:[e.jsx(i,{onClick:()=>window.location.href="/login",children:"Sign in"}),e.jsx(i,{variant:"outline",onClick:()=>window.location.href="/",children:"Return Home"})]})]})})})});const s=typeof a.configurationData=="string"?JSON.parse(a.configurationData):a.configurationData,m=new Date(a.validUntil)<new Date,j=a.discountPercentage&&a.discountPercentage>0,N=()=>{if(m)return e.jsx(r,{variant:"destructive",children:"Expired"});switch(a.status){case"DRAFT":return e.jsx(r,{variant:"secondary",children:"Draft"});case"VIEWED":return e.jsx(r,{variant:"outline",className:"bg-blue-50 text-blue-700",children:"Viewed"});case"SENT":return e.jsx(r,{variant:"outline",className:"bg-purple-50 text-purple-700",children:"Sent"});case"ACCEPTED":return e.jsx(r,{variant:"default",className:"bg-green-600",children:"Accepted"});case"EXPIRED":return e.jsx(r,{variant:"destructive",children:"Expired"});default:return e.jsx(r,{variant:"secondary",children:a.status})}},p=t=>t?typeof t=="string"?t:t.width&&t.height?`${t.width} x ${t.height} mm`:t.name?t.name:"":"",g=()=>{const t=document.createElement("a");t.href=`/api/quotes/${a.id}/pdf${d}`,t.target="_blank",t.rel="noopener noreferrer",document.body.appendChild(t),t.click(),document.body.removeChild(t)};return e.jsx(c,{children:e.jsxs("div",{className:"container max-w-4xl mx-auto px-4 py-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx(k,{className:"h-12 w-12 text-primary mx-auto mb-4"}),e.jsx("h1",{className:"text-3xl font-bold",children:"Your Door Quote"}),e.jsxs("p",{className:"text-gray-500 mt-2",children:["Reference: ",a.referenceNumber]})]}),e.jsxs(x,{className:"mb-6",children:[e.jsxs(v,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(b,{className:"text-xl",children:"Quote Details"}),e.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["Created on ",o(new Date(a.createdAt),"d MMMM yyyy")]})]}),N()]}),e.jsxs(u,{children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[(a.outsideImageBase64||a.insideImageBase64)&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-semibold text-gray-700",children:"Door Preview"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.outsideImageBase64&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Outside View"}),e.jsx("img",{src:a.outsideImageBase64,alt:"Outside view",className:"w-full rounded-lg border shadow-sm"})]}),a.insideImageBase64&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Inside View"}),e.jsx("img",{src:a.insideImageBase64,alt:"Inside view",className:"w-full rounded-lg border shadow-sm"})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-semibold text-gray-700",children:"Configuration"}),e.jsxs("div",{className:"space-y-2 text-sm",children:[s?.modelName&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Model:"}),e.jsx("span",{className:"font-medium",children:s.modelName})]}),s?.collectionName&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Collection:"}),e.jsx("span",{className:"font-medium",children:s.collectionName})]}),(s?.outsideColourName||s?.outsideColour?.name)&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Outside Colour:"}),e.jsx("span",{className:"font-medium",children:s.outsideColourName||s.outsideColour?.name})]}),(s?.insideColourName||s?.insideColour?.name)&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Inside Colour:"}),e.jsx("span",{className:"font-medium",children:s.insideColourName||s.insideColour?.name})]}),(s?.glazingName||s?.glazing?.name)&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Glazing:"}),e.jsx("span",{className:"font-medium",children:s.glazingName||s.glazing?.name})]}),(s?.thermalName||s?.thermal?.name)&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Thermal Standard:"}),e.jsx("span",{className:"font-medium",children:s.thermalName||s.thermal?.name})]}),(s?.frameColourName||s?.frameColour?.name)&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Frame Colour:"}),e.jsx("span",{className:"font-medium",children:s.frameColourName||s.frameColour?.name})]}),s?.dimensions&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-gray-500",children:"Dimensions:"}),e.jsx("span",{className:"font-medium",children:p(s.dimensions)})]})]})]})]}),e.jsx(C,{className:"my-6"}),e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500 mb-2",children:[e.jsx(E,{className:"h-4 w-4"}),m?e.jsxs("span",{className:"text-red-500",children:["Expired on ",o(new Date(a.validUntil),"d MMMM yyyy")]}):e.jsxs("span",{children:["Valid until ",o(new Date(a.validUntil),"d MMMM yyyy")]})]})}),e.jsxs("div",{className:"text-right",children:[j&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-gray-400 line-through",children:["£",a.subtotal]}),e.jsxs(r,{variant:"secondary",className:"text-xs bg-green-100 text-green-700 mb-1",children:[a.discountPercentage,"% off"]})]}),e.jsxs("p",{className:"text-3xl font-bold text-primary",children:["£",a.finalTotal]}),e.jsx("p",{className:"text-xs text-gray-500",children:"inc. VAT"})]})]}),e.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row gap-3",children:[e.jsxs(i,{onClick:g,className:"flex-1",children:[e.jsx(I,{className:"h-4 w-4 mr-2"}),"Download PDF"]}),e.jsx(i,{variant:"outline",onClick:()=>window.location.href="/",className:"flex-1",children:"Configure Another Door"})]})]})]}),e.jsxs("p",{className:"text-center text-sm text-gray-500",children:["Have questions about this quote? Contact us at"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-primary hover:underline",children:"[email protected]"})]})]})})}export{L 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.