1"use strict";(self.webpackChunkquickGrowth=self.webpackChunkquickGrowth||[]).push([[2331],{2331(e,r,s){s.r(r),s.d(r,{default:()=>i});var t=s(2555),a=s(5043),n=s(5016),l=s(579);const o={client_phone:"Phone",client_email:"Email",website:"Website",client_name:"Contact Name",company_name:"Company Name"};function d(e){let{message:r,type:s="success",onClose:t}=e;return(0,a.useEffect)((()=>{const e=setTimeout(t,4e3);return()=>clearTimeout(e)}),[t]),(0,l.jsxs)("div",{className:"fixed bottom-6 right-6 z-50 flex items-center gap-3 ".concat("error"===s?"bg-red-500/90":"bg-emerald-500/90"," text-white px-4 py-3 rounded-xl shadow-xl text-sm font-medium"),children:["error"===s?"\u274c":"\u2705"," ",r,(0,l.jsx)("button",{onClick:t,className:"ml-2 opacity-70 hover:opacity-100 text-lg leading-none",children:"\xd7"})]})}function i(){const{profile:e}=(0,n.As)(),[r,s]=(0,a.useState)([]),[i,c]=(0,a.useState)(!0),[m,x]=(0,a.useState)({}),[p,h]=(0,a.useState)(null),[u,f]=(0,a.useState)(null),b=function(e){return h({message:e,type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success"})},j=(0,a.useCallback)((async()=>{c(!0);try{const e=await fetch("/api/admin/contact-reports"),r=await e.json();s(Array.isArray(r)?r:[])}catch(e){b("Failed to load reports","error")}finally{c(!1)}}),[]);(0,a.useEffect)((()=>{j()}),[j]);const g=async(e,r)=>{x((s=>(0,t.A)((0,t.A)({},s),{},{[e]:r})));try{const t=await fetch("/api/admin/contact-reports/".concat(e,"/resolve"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r})}),a=await t.json();if(!t.ok)throw new Error(a.error||"Action failed");s((r=>r.filter((r=>r.id!==e)))),b("clear"===r?"\ud83d\uddd1\ufe0f Field cleared from lead":"Report dismissed")}catch(a){b(a.message,"error")}finally{x((r=>{const s=(0,t.A)({},r);return delete s[e],s}))}};return(0,l.jsxs)("div",{className:"space-y-6 max-w-4xl",children:[p&&(0,l.jsx)(d,{message:p.message,type:p.type,onClose:()=>h(null)}),(0,l.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-primary",children:"Contact Info Reports"}),(0,l.jsx)("p",{className:"text-secondary text-sm mt-1",children:"Sales reps flagged these contact details as incorrect \u2014 review and clear or dismiss each report"})]}),(0,l.jsxs)("button",{onClick:j,className:"flex items-center gap-2 px-4 py-2 rounded-xl border border-theme text-secondary text-sm hover:border-theme-hover transition-colors",children:[(0,l.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]})]}),(0,l.jsxs)("div",{className:"bg-card border border-orange-500/20 rounded-2xl p-4 flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(249,115,22,0.12)",border:"1px solid rgba(249,115,22,0.25)"},children:(0,l.jsx)("svg",{className:"w-6 h-6 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-2xl font-bold text-primary",children:r.length}),(0,l.jsx)("p",{className:"text-sm text-secondary",children:"pending reports from reps"})]})]}),i?(0,l.jsx)("div",{className:"flex justify-center py-16",children:(0,l.jsx)("div",{className:"w-8 h-8 border-2 border-orange-500 border-t-transparent rounded-full animate-spin"})}):0===r.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 bg-card border border-theme rounded-2xl text-center",children:[(0,l.jsx)("div",{className:"w-14 h-14 rounded-2xl bg-emerald-500/10 flex items-center justify-center mb-4",children:(0,l.jsx)("svg",{className:"w-7 h-7 text-emerald-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,l.jsx)("p",{className:"text-primary font-semibold",children:"No pending reports"}),(0,l.jsx)("p",{className:"text-muted text-sm mt-1",children:"Reps haven't flagged any contact info issues yet"})]}):(0,l.jsx)("div",{className:"space-y-3",children:r.map((e=>{const r=e.leads||{},s=o[e.field_name]||e.field_name,t=u===e.id;return(0,l.jsxs)("div",{className:"bg-card border border-theme rounded-2xl overflow-hidden",children:[(0,l.jsxs)("button",{onClick:()=>f((r=>r===e.id?null:e.id)),className:"w-full flex items-center justify-between px-5 py-4 hover:bg-card-hover transition-colors text-left gap-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0 bg-orange-500/10 border border-orange-500/20",children:(0,l.jsx)("svg",{className:"w-4 h-4 text-orange-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9"})})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,l.jsx)("p",{className:"text-sm font-semibold text-primary truncate",children:r.company_name||r.title||"Unknown Lead"}),(0,l.jsxs)("span",{className:"text-[10px] font-bold px-1.5 py-0.5 rounded border bg-orange-500/10 text-orange-400 border-orange-500/25 flex-shrink-0",children:[s," flagged"]})]}),(0,l.jsxs)("p",{className:"text-[11px] text-muted mt-0.5",children:["by ",e.reporter_name," \xb7 ",new Date(e.created_at).toLocaleDateString()]})]})]}),(0,l.jsx)("svg",{className:"w-4 h-4 text-muted flex-shrink-0 transition-transform ".concat(t?"rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),t&&(0,l.jsxs)("div",{className:"border-t border-theme px-5 pb-5 pt-4 space-y-4",children:[(0,l.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[{label:"Lead",value:r.company_name||r.client_name||r.title},{label:"Reported field",value:s},{label:"Current value",value:e.field_value||"(empty)"},{label:"Reported by",value:e.reporter_name}].map((e=>{let{label:r,value:s}=e;return(0,l.jsxs)("div",{className:"bg-surface border border-theme rounded-xl px-3 py-2.5",children:[(0,l.jsx)("p",{className:"text-[10px] text-muted font-semibold uppercase tracking-wider mb-0.5",children:r}),(0,l.jsx)("p",{className:"text-sm text-primary truncate",children:s||"\u2014"})]},r)}))}),e.reason&&(0,l.jsxs)("div",{className:"bg-surface border border-yellow-500/20 rounded-xl p-3",children:[(0,l.jsx)("p",{className:"text-[10px] text-muted font-semibold uppercase tracking-wider mb-1",children:"Rep's note"}),(0,l.jsxs)("p",{className:"text-sm text-secondary leading-relaxed",children:['"',e.reason,'"']}
1)]}),(0,l.jsxs)("div",{className:"bg-surface border border-theme rounded-xl p-3 space-y-1.5",children:[(0,l.jsx)("p",{className:"text-[10px] text-muted font-semibold uppercase tracking-wider mb-2",children:"Current lead contact data"}),[{l:"Phone",v:r.client_phone},{l:"Email",v:r.client_email},{l:"Website",v:r.website}].map((r=>{let{l:s,v:t}=r;return t&&(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"text-[11px] text-muted w-14",children:s}),(0,l.jsx)("span",{className:"text-xs font-medium truncate ".concat(o[e.field_name]===s?"text-orange-400":"text-primary"),children:t}),o[e.field_name]===s&&(0,l.jsx)("span",{className:"text-[9px] text-orange-400 border border-orange-500/25 bg-orange-500/10 px-1 py-0.5 rounded font-bold flex-shrink-0",children:"FLAGGED"})]},s)}))]}),(0,l.jsxs)("div",{className:"flex gap-3 pt-1",children:[(0,l.jsxs)("button",{onClick:()=>g(e.id,"clear"),disabled:!!m[e.id],className:"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl text-sm font-semibold transition-colors bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 disabled:opacity-50",children:["clear"===m[e.id]?(0,l.jsx)("div",{className:"w-4 h-4 border-2 border-red-400/40 border-t-red-400 rounded-full animate-spin"}):(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Clear ",s," from lead"]}),(0,l.jsxs)("button",{onClick:()=>g(e.id,"dismiss"),disabled:!!m[e.id],className:"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl text-sm font-semibold transition-colors bg-surface text-secondary border border-theme hover:border-theme-hover disabled:opacity-50",children:["dismiss"===m[e.id]?(0,l.jsx)("div",{className:"w-4 h-4 border-2 border-secondary/40 border-t-secondary rounded-full animate-spin"}):(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),"Dismiss \u2014 info is correct"]})]})]})]},e.id)}))})]})}}}]); 2//# sourceMappingURL=2331.c6bba70d.chunk.js.map
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.