1import{c as b,r as n,t as d,b as y,j as e,a as j}from"./index-Cs2_D4wV.js";import{A as S,C as v}from"./AdminLayout-DTRs4i_3.js";import"./calendar-CBU3xcq-.js";import"./chevron-left-IIeHZqgT.js";import"./log-out-Dh-ffMlQ.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const z=b("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),c={new:{bg:"#dbeafe",color:"#1d4ed8"},contacted:{bg:"#fef3c7",color:"#d97706"},estimating:{bg:"#ede9fe",color:"#7c3aed"},approved:{bg:"#dcfce7",color:"#16a34a"},declined:{bg:"#fee2e2",color:"#dc2626"},closed:{bg:"#f3f4f6",color:"#6b7280"}};function P(){const[s,A]=n.useState(null),[m,g]=n.useState(""),[p,x]=n.useState(""),[f,h]=n.useState(""),u=d.useUtils(),{data:r,isLoading:E}=d.admin.estimates.list.useQuery(),{data:a}=d.admin.estimates.get.useQuery({id:s},{enabled:!!s}),o=d.admin.estimates.updateStatus.useMutation({onSuccess:()=>{u.admin.estimates.list.invalidate(),u.admin.estimates.get.invalidate({id:s}),y.success("Updated!")},onError:t=>y.error(t.message)}),l={width:"100%",padding:"0.55rem 0.75rem",border:"1px solid #d1d5db",borderRadius:8,fontSize:"0.85rem",color:"#1a2e1a",background:"white",boxSizing:"border-box"};return e.jsxs(S,{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:34",title:"Estimate Requests",children:[e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:35",style:{display:"grid",gridTemplateColumns:s?"1fr 1fr":"1fr",gap:"1rem"},children:[e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:37",style:{background:"white",borderRadius:14,border:"1px solid #e8f0e8",overflow:"hidden"},children:[e.jsx("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:38",style:{padding:"0.875rem 1.25rem",borderBottom:"1px solid #f0f4f0"},children:e.jsxs("h3",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:39",style:{margin:0,fontSize:"0.875rem",fontWeight:700,color:"#1a2e1a"},children:["All Requests (",(r||[]).length,")"]})}),E?e.jsx("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:42",style:{display:"flex",justifyContent:"center",padding:"2rem"},children:e.jsx(j,{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:42",size:20,style:{animation:"spin 1s linear infinite",color:"#2d6a2d"}})}):(r||[]).length===0?e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:44",style:{textAlign:"center",padding:"3rem",color:"#9ca3af"},children:[e.jsx(v,{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:45",size:36,style:{margin:"0 auto 0.75rem",opacity:.4}}),e.jsx("p",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:46",style:{margin:0},children:"No estimate requests yet."})]}):(r||[]).map(t=>{const i=c[t.status]||c.new;return e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:52",onClick:()=>{A(t.id),g(t.status),x(t.adminNotes||""),h(t.quotedPrice||"")},style:{padding:"0.875rem 1.25rem",borderBottom:"1px solid #f8faf8",cursor:"pointer",background:s===t.id?"#f0fdf0":"white"},children:[e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:57",style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:2},children:[e.jsx("span",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:58",style:{fontWeight:700,fontSize:"0.875rem",color:"#1a2e1a"},children:t.name}),e.jsx("span",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:59",style:{fontSize:"0.65rem",fontWeight:700,padding:"0.15rem 0.5rem",borderRadius:999,background:i.bg,color:i.color,textTransform:"capitalize"},children:t.status})]}),e.jsxs("p",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:61",style:{margin:0,fontSize:"0.75rem",color:"#6b7280"},children:[t.address," â ",t.phone]}),e.jsx("p",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:62",style:{margin:0,fontSize:"0.7rem",color:"#9ca3af"},children:new Date(t.createdAt).toLocaleDateString()})]},t.id)})]}),s&&a&&e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:71",style:{background:"white",borderRadius:14,border:"1px solid #e8f0e8",padding:"1.25rem",overflowY:"auto",maxHeight:"80vh"},children:[e.jsx("h3",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:72",style:{margin:"0 0 1rem",fontSize:"0.9rem",fontWeight:700,color:"#1a2e1a"},children:a.name}),[["Phone",a.phone],["Email",a.email],["Address",a.address],["Yard Area",a.yardArea],["Lawn Size",a.lawnSize],["Grass Condition",a.grassCondition],["Services",[a.needsMowing?"Mowing":"",a.needsTrimming?"Trimming":""].filter(
6Boolean).join(", ")],["Additional",a.additionalServices],["Preferred Start",a.preferredStartDate],["Notes",a.notes]].filter(([,t])=>t).map(([t,i])=>e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:85",style:{marginBottom:"0.625rem"},children:[e.jsx("p",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:86",style:{margin:0,fontSize:"0.7rem",color:"#9ca3af",fontWeight:600,textTransform:"uppercase"},children:t}),e.jsx("p",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:87",style:{margin:0,fontSize:"0.85rem",color:"#1a2e1a"},children:String(i)})]},String(t))),(a.photoUrls||[]).length>0&&e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:91",style:{marginBottom:"0.875rem"},children:[e.jsx("p",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:92",style:{margin:"0 0 0.5rem",fontSize:"0.7rem",color:"#9ca3af",fontWeight:600,textTransform:"uppercase"},children:"Photos"}),e.jsx("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:93",style:{display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:a.photoUrls.map((t,i)=>e.jsxs("a",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:95",href:t,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"0.3rem",fontSize:"0.75rem",color:"#2d6a2d"},children:[e.jsx(z,{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:96",size:12}),"Photo ",i+1]},i))})]}),e.jsxs("div",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:102",style:{borderTop:"1px solid #f0f4f0",paddingTop:"0.875rem",marginTop:"0.875rem"},children:[e.jsx("p",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:103",style:{margin:"0 0 0.5rem",fontSize:"0.75rem",fontWeight:700,color:"#374151"},children:"Update Status"}),e.jsx("select",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:104",style:{...l,marginBottom:"0.5rem"},value:m,onChange:t=>g(t.target.value),children:Object.keys(c).map(t=>e.jsx("option",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:105",value:t,style:{textTransform:"capitalize"},children:t},t))}),e.jsx("input",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:107",style:{...l,marginBottom:"0.5rem"},value:f,onChange:t=>h(t.target.value),placeholder:"Quoted price ($)"}),e.jsx("textarea",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:108",style:{...l,minHeight:60,resize:"vertical",marginBottom:"0.75rem"},value:p,onChange:t=>x(t.target.value),placeholder:"Admin notes..."}),e.jsx("button",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:109",onClick:()=>o.mutate({id:s,status:m,adminNotes:p,quotedPrice:f}),disabled:o.isPending,style:{padding:"0.55rem 1.25rem",borderRadius:8,background:"#1a3a1a",color:"white",border:"none",fontSize:"0.85rem",fontWeight:600,cursor:"pointer"},children:o.isPending?"Saving...":"Save Changes"})]})]})]}),e.jsx("style",{"data-loc":"client/src/pages/admin/AdminEstimates.tsx:120",children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"})]})}export{P 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.