PageSourceSearch

https://www.smallbizagent.ai/assets/print-CvB5_QM4.js

js smallbizagent.ai collected 2026-10-05 15:05:38 UTC 6,283 bytes, 6 lines download raw bytes

1import{u as h,j as e}from"./vendor-query-CnAhr2B8.js";import{a0 as N,ay as p,aa as r}from"./index-CLUtDhnY.js";import"./vendor-ui-CYA7SV0W.js";import"./vendor-charts-CPMWc2oJ.js";import"./vendor-forms-UY-il7MQ.js";function k(){var l,i,n,d,x,o,m;const y=N(),{id:c}=y,{data:t,isLoading:j}=h({queryKey:[`/api/quotes/${c}`],queryFn:async()=>{const a=await fetch(`/api/quotes/${c}`);if(!a.ok)throw new Error("Failed to fetch quote");return a.json()},enabled:!!c}),{data:s}=h({queryKey:["/api/business"]});if(j)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx("div",{className:"animate-spin w-8 h-8 border-4 border-primary rounded-full border-t-transparent"})});if(!t)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx("p",{className:"text-gray-500",children:"Quote not found"})});const u=a=>{switch(a){case"accepted":return"text-green-600";case"declined":return"text-red-600";case"expired":return"text-gray-500";case"converted":return"text-blue-600";default:return"text-yellow-600"}};return e.jsxs("div",{className:"min-h-screen bg-white p-8 print:p-0",children:[e.jsx("style",{children:`
2        @media print {
3          body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
4          .no-print { display: none !important; }
5        }
6      `}),e.jsxs("div",{className:"no-print mb-6 flex gap-4",children:[e.jsx("button",{onClick:()=>window.print(),className:"px-4 py-2 bg-black text-white rounded-lg hover:bg-gray-800",children:"Print Quote"}),e.jsx("button",{onClick:()=>window.history.back(),className:"px-4 py-2 bg-gray-200 text-gray-800 rounded-lg hover:bg-gray-300",children:"Back"})]}),e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"flex justify-between items-start mb-8",children:[e.jsxs("div",{children:[(s==null?void 0:s.logoUrl)&&e.jsx("img",{src:s.logoUrl,alt:s.name,className:"h-16 w-auto object-contain mb-3"}),e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"QUOTE"}),e.jsxs("p",{className:"text-gray-600 mt-1",children:["#",t.quoteNumber]})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:(s==null?void 0:s.name)||"Your Business"}),(s==null?void 0:s.address)&&e.jsx("p",{className:"text-gray-600",children:s.address}),(s==null?void 0:s.city)&&(s==null?void 0:s.state)&&e.jsxs("p",{className:"text-gray-600",children:[s.city,", ",s.state," ",s.zip]}),(s==null?void 0:s.phone)&&e.jsx("p",{className:"text-gray-600",children:s.phone}),(s==null?void 0:s.email)&&e.jsx("p",{className:"text-gray-600",children:s.email})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-8 mb-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-500 uppercase mb-2",children:"Prepared For"}),e.jsxs("p",{className:"font-medium text-gray-900",children:[(l=t.customer)==null?void 0:l.firstName," ",(i=t.customer)==null?void 0:i.lastName]}),((n=t.customer)==null?void 0:n.email)&&e.jsx("p",{className:"text-gray-600",children:t.customer.email}),((d=t.customer)==null?void 0:d.phone)&&e.jsx("p",{className:"text-gray-600",children:t.customer.phone}),((x=t.customer)==null?void 0:x.address)&&e.jsxs("p",{className:"text-gray-600",children:[t.customer.address,t.customer.city&&`, ${t.customer.city}`,t.customer.state&&`, ${t.customer.state}`,t.customer.zip&&` ${t.customer.zip}`]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"mb-2",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-500 uppercase",children:"Quote Date"}),e.jsx("p",{className:"text-gray-900",children:p(t.createdAt)})]}),t.validUntil&&e.jsxs("div",{className:"mb-2",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-500 uppercase",children:"Valid Until"}),e.jsx("p",{className:"text-gray-900",children:p(t.validUntil)})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-semibold text-gray-500 uppercase",children:"Status"}),e.jsx("p",{className:`font-medium ${u(t.status)}`,children:(o=t.status)==null?void 0:o.toUpperCase()})]})]})]}),e.jsxs("table",{className:"w-full mb-8",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b-2 border-gray-200",children:[e.jsx("th",{className:"text-left py-3 text-sm font-semibold text-gray-600",children:"Description"}),e.jsx("th",{className:"text-right py-3 text-sm font-semibold text-gray-600",children:"Qty"}),e.jsx("th",{className:"text-right py-3 text-sm font-semibold text-gray-600",children:"Unit Price"}),e.jsx("th",{className:"text-right py-3 text-sm font-semibold text-gray-600",children:"Amount"})]})}),e.jsx("tbody",{children:(m=t.items)==null?void 0:m.map((a,g)=>e.jsxs("tr",{className:"border-b border-gray-100",children:[e.jsx("td",{className:"py-3 text-gray-900",children:a.description}),e.jsx("td",{className:"py-3 text-right text-gray-600",children:a.quantity}),e.jsx("td",{className:"py-3 text-right text-gray-600",children:r(a.unitPrice)}),e.jsx("td",{className:"py-3 text-right text-gray-900",children:r(a.amount||a.quantity*a.unitPrice)})]},g))})]}),e.jsx("div",{className:"flex justify-end mb-8",children:e.jsxs("div",{className:"w-64",children:[e.jsxs("div",{className:"flex justify-between py-2",children:[e.jsx("span",{className:"text-gray-600",children:"Subtotal"}),e.jsx("span",{className:"text-gray-900",children:r(t.amount||t.total)})]}),(t.tax||0)>0&&e.jsxs("div",{className:"flex justify-between py-2",children:[e.jsx("span",{className:"text-gray-600",children:"Tax"}),e.jsx("span",{className:"text-gray-900",children:r(t.tax)})]}),e.jsxs("div",{className:"flex justify-between py-3 border-t-2 border-gray-200 font-bold",children:[e.jsx("span",{className:"text-gray-900",children:"Total"}),e.jsx("span",{className:"text-gray-900",children:r(t.total)})]})]})}),t.notes&&e.jsxs("div",{className:"border-t border-gray-200 pt-6",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-500 uppercase mb-2",children:"Notes"}),e.jsx("p",{className:"text-gray-600 whitespace-pre-wrap",children:t.notes})]}),e.jsx("div",{className:"mt-12 pt-6 border-t border-gray-200 text-center text-gray-500 text-sm",children:e.jsx("p",{children:"Thank y
6ou for considering our services!"})})]})]})}export{k 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.