PageSourceSearch

https://a2zworkhub.com/assets/js/GoogleReviewsManagement-Coc9NHUg.js

js a2zworkhub.com collected 2026-10-02 00:47:28 UTC 12,658 bytes, 1 lines download raw bytes

1import{x as S,a as d,a9 as i,j as e,F as C,af as R,a5 as M,I as F,X as A,a3 as E,E as P}from"./index-WXqAjLLd.js";import{s as h}from"./fmcSupabase-B-9V4TmF.js";import{P as I}from"./plus-Cw03IAwU.js";import{S as y}from"./star-Dvys6OPS.js";import{S as q}from"./square-pen-Dtm-eL2p.js";import{S as T}from"./save-DVNPgJu2.js";const f={reviewer_name:"",review_text:"",rating:1,photo_url:""},w=["bg-red-500","bg-orange-500","bg-amber-500","bg-emerald-500","bg-teal-500","bg-sky-500","bg-indigo-500","bg-violet-500","bg-fuchsia-500","bg-rose-500"],z=r=>r?.trim()?.charAt(0).toUpperCase()||"?",L=(r,x)=>{if(!r)return x==="dark"?"bg-gray-800":"bg-gray-200";let l=0;for(let o=0;o<r.length;o++)l=r.charCodeAt(o)+((l<<5)-l),l=l&l;const a=Math.abs(l)%w.length;return w[a]},Z=()=>{const{effectiveTheme:r}=S(),[x,l]=d.useState([]),[a,o]=d.useState(f),[m,p]=d.useState(null),[k,c]=d.useState(!1),[b,g]=d.useState(!1);d.useEffect(()=>{u()},[]);const u=async()=>{try{g(!0);const{data:t,error:s}=await h.from("google_reviews").select("*").order("id",{ascending:!1});if(s)throw s;l(t||[])}catch{i.error("Failed to fetch sentiment data")}finally{g(!1)}},v=()=>{o(f),p(null),c(!0)},j=t=>{o({reviewer_name:t.reviewer_name??"",review_text:t.review_text??"",rating:t.rating??1,photo_url:t.photo_url??""}),p(t.id),c(!0)},N=async()=>{if(!a.reviewer_name||!a.review_text){i.error("Please fill all required signal fields");return}g(!0);try{if(m){const{error:t}=await h.from("google_reviews").update(a).eq("id",m);if(t)throw t;i.success("Sentiment node recalibrated"),u()}else{const{data:t,error:s}=await h.from("google_reviews").insert([a]).select();if(s)throw s;i.success("New sentiment node registered"),l(n=>[t[0],...n])}c(!1)}catch{i.error("Failed to commit sentiment changes")}finally{g(!1)}},$=async t=>{if(confirm("Decommission this sentiment node?"))try{const{error:s}=await h.from("google_reviews").delete().eq("id",t);if(s)throw s;l(n=>n.filter(_=>_.id!==t)),i.success("Sentiment node purged")}catch{i.error("Failed to purge node")}};return e.jsxs("div",{className:`space-y-8 pb-10 transition-colors duration-300 ${r==="dark"?"text-white":"text-gray-900"}`,children:[e.jsx(C,{}),e.jsxs("div",{className:`rounded-3xl shadow-2xl p-8 transition-all overflow-hidden relative ${r==="dark"?"bg-gray-900 border border-gray-800":"bg-red-600 text-white"}`,children:[r==="dark"&&e.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-yellow-400/5 blur-[100px] -mr-32 -mt-32"}),e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center relative z-10",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-black uppercase tracking-tighter mb-2",children:"Sentiment Matrix"}),e.jsx("p",{className:`${r==="dark"?"text-gray-400":"text-red-100"} text-lg font-bold uppercase tracking-widest`,children:"Google Reviews Command"})]}),e.jsxs("button",{onClick:v,className:`mt-4 md:mt-0 px-8 py-4 rounded-2xl font-black text-xs uppercase tracking-[0.2em] transition-all flex items-center space-x-2 shadow-xl ${r==="dark"?"bg-yellow-400 text-black hover:bg-yellow-500 shadow-yellow-950/20":"bg-white text-red-600 hover:bg-gray-50 focus:ring-2 focus:ring-white/50"}`,children:[e.jsx(I,{className:"h-5 w-5"}),e.jsx("span",{children:"Register Review"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:[x.map(t=>e.jsxs("div",{className:`group rounded-[2.5rem] shadow-xl border-2 transition-all duration-300 overflow-hidden flex flex-col ${r==="dark"?"bg-gray-900 border-gray-800 hover:border-yellow-400/30 shadow-yellow-950/5":"bg-white border-gray-100 hover:border-red-500/20 shadow-sm"}`,children:[e.jsxs("div",{className:"p-8 flex-1",children:[e.jsxs("div",{className:"flex items-center mb-6",children:[e.jsx("div",{className:`w-14 h-14 rounded-2xl flex items-center justify-center mr-4 shadow-lg transition-transform group-hover:scale-110 ${L(t.reviewer_name,r)}`,children:e.jsx("span",{className:"text-white font-black text-xl",children:z(t.reviewer_name)})}),e.jsxs("div",{children:[e.jsx("h3",{className:`text-lg font-black uppercase tracking-tight truncate max-w-[150px] ${r==="dark"?"text-white":"text-gray-900"}`,children:t.reviewer_name}),e.jsx("div",{className:"flex space-x-0.5 mt-0.5",children:[...Array(5)].map((s,n)=>e.jsx(y,{className:`h-3.5 w-3.5 ${n<(t.rating||0)?r==="dark"?"text-yellow-400 fill-yellow-400":"text-red-500 fill-red-500":r==="dark"?"text-gray-800":"text-gray-200"}`},n))})]})]}),e.jsxs("div",{className:`relative p-6 rounded-2xl border-2 italic ${r==="dark"?"bg-gray-950/50 border-gray-800 text-gray-400":"bg-gray-50 border-gray-50 text-gray-600"}`,children:[e.jsxs("p",{className:"text-sm font-bold leading-relaxed line-clamp-4",children:['"',t.review_text,'"']}),e.jsxs("div",{className:`absolute -bottom-3 right-6 px-3 py-1 rounded-lg text-[9px] font-black uppercase tracking-widest ${r==="dark"?"bg-gray-800 text-yellow-400":"bg-white text-red-600 shadow-sm"}`,children:["Ingested Node ",t.id]})]})]}),e.jsxs("div",{className:`px-8 py-6 border-t flex justify-between items-center ${r==="dark"?"border-gray-800 bg-gray-950/20":"border-gray-50 bg-gray-50/20"}`,children:[e.jsxs("div",{className:`flex items-center space-x-2 text-[10px] font-black uppercase tracking-widest ${r==="dark"?"text-gray-600":"text-gray-400"}`,children:[e.jsx(R,{className:"h-3 w-3"}),e.jsxs("span",{children:["Signal Strength: ",t.rating*20,"%"]})]}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx("button",{onClick:()=>j(t),className:`p-2.5 rounded-xl transition-all ${r==="dark"?"text-gray-500 hover:bg-gray-800 hover:text-yellow-400":"text-gray-400 hover:bg-white hover:text-blue-600 shadow-sm"}`,children:e.jsx(q,{className:"h-5 w-5"})}),e.jsx("button",{onClick:()=>$(t.id),className:`p-2.5 rounded-xl transition-all ${r==="dark"?"text-gray-500 hover:bg-gray-800 hover:text-red-400":"text-gray-400 hover:bg-white hover:text-red-600 shadow-sm"}`,children:e.jsx(M,{className:"h-5 w-5"})})]})]})]},t.id)),x.length===0&&!b&&e.jsxs("div",{className:"col-span-full py-40 text-center",children:[e.jsx(y,{className:`h-20 w-20 mx-auto mb-6 opacity-10 animate-pulse ${r==="dark"?"text-yellow-400":"text-red-600"}`}),e.jsx("h3",{className:`text-xl font-black uppercase tracking-tighter mb-2 ${r==="dark"?"text-gray-700":"text-gray-300"}`,children:"Zero Sentiment Detected"}),e.jsx("p",{className:`text-[10px] font-bold uppercase tracking-[0.2em] ${r==="dark"?"text-gray-800":"text-gray-400"}`,children:"Awaiting Google signal ingestion"})]})]}),e.jsx("div",{className:`rounded-[2.5rem] p-8 border-2 transition-all ${r==="dark"?"bg-gray-900 border-gray-800 shadow-inner":"bg-gray-50 border-gray-100 shadow-sm"}`,children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("div",{className:`p-4 rounded-2xl mr-6 shadow-xl ${r==="dark"?"bg-gray-950 text-yellow-400 border border-gray-800":"bg-white text-red-600"}`,children:e.jsx(F,{className:"h-6 w-6"})}),e.jsxs("div",{children:[e.jsx("h4",{className:`text-lg font-black uppercase tracking-tight ${r==="dark"?"text-white":"text-gray-900"}`,children:"Sentiment Propagation Protocol"}),e.jsx("p",{className:`text-xs font-bold uppercase tracking-widest mt-2 leading-relaxed ${r==="dark"?"text-gray-500":"text-gray-400"}`,children:"Reviews documented in this matrix are mirrored across public landing vectors to establish operational transparency. Periodic interrogation of the sentiment layer is required to maintain brand homeostasis within the Courier ecosystem."})]})]})}),k&&e.jsx("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[100] p-4",children:e.jsxs("div",{className:`rounded-[3rem] shadow-2xl p-10 w-full max-w-xl relative transition-all ${r==="dark"?"bg-gray-900 border-2 border-gray-800":"bg-white border-2 border-gray-100"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-10",children:[e.jsxs("div",{children:[e.jsx("h2",{className:`text-3xl font-black uppercase tracking-tighter ${r==="dark"?"text-white":"text-gray-900"}`,children:m?"Recalibrate Node":"Register Node"}),e.jsx("p",{className:`text-[10px] font-black uppercase tracking-widest mt-1 ${r==="dark"?"text-yellow-400":"text-red-600"}`,children:"Manual signal calibration"})]}),e.jsx("button",{onClick:()=>c(!1),className:`p-3 rounded-2xl transition-all ${r==="dark"?"text-gray-500 hover:text-white hover:bg-gray-800":"text-gray-400 hover:bg-gray-100"}`,children:e.jsx(A,{className:"h-7 w-7"})})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:`block text-[10px] font-black uppercase tracking-[0.2em] ${r==="dark"?"text-gray-500":"text-gray-400"}`,children:"Reviewer Identity"}),e.jsxs("div",{className:"relative",children:[e.jsx(E,{className:`absolute left-5 top-1/2 -translate-y-1/2 h-5 w-5 ${r==="dark"?"text-gray-700":"text-gray-300"}`}),e.jsx("input",{type:"text",placeholder:"Entity Name",value:a.reviewer_name,onChange:t=>o({...a,reviewer_name:t.target.value}),className:`w-full pl-14 pr-6 py-4 border-2 rounded-2xl text-sm font-black transition-all focus:outline-none ${r==="dark"?"bg-gray-950 border-gray-800 text-white placeholder-gray-800 focus:border-yellow-400/50":"bg-gray-50 border-gray-100 text-gray-900 placeholder-gray-300 focus:border-red-500/50"}`})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:`block text-[10px] font-black uppercase tracking-[0.2em] ${r==="dark"?"text-gray-500":"text-gray-400"}`,children:"Sentiment Manifest"}),e.jsx("textarea",{placeholder:"Review content ingestion...",value:a.review_text,onChange:t=>o({...a,review_text:t.target.value}),className:`w-full px-6 py-4 border-2 rounded-2xl text-sm font-bold min-h-[120px] transition-all focus:outline-none ${r==="dark"?"bg-gray-950 border-gray-800 text-white placeholder-gray-800 focus:border-yellow-400/50":"bg-gray-50 border-gray-100 text-gray-900 placeholder-gray-300 focus:border-red-500/50"}`})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:`block text-[10px] font-black uppercase tracking-[0.2em] ${r==="dark"?"text-gray-500":"text-gray-400"}`,children:"Signal Magnitude (Rating)"}),e.jsxs("div",{className:`flex items-center justify-between p-6 rounded-2xl border-2 ${r==="dark"?"bg-gray-950 border-gray-800":"bg-gray-50 border-gray-100"}`,children:[e.jsx("div",{className:"flex space-x-2",children:[...Array(5)].map((t,s)=>
1e.jsx(y,{className:`cursor-pointer h-8 w-8 transition-all hover:scale-125 ${s<a.rating?r==="dark"?"text-yellow-400 fill-yellow-400":"text-red-500 fill-red-500":r==="dark"?"text-gray-800":"text-gray-200"}`,onClick:()=>o({...a,rating:s+1})},s))}),e.jsxs("span",{className:`text-xl font-black ${r==="dark"?"text-white":"text-gray-900"}`,children:[a.rating,".0"]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("label",{className:`block text-[10px] font-black uppercase tracking-[0.2em] ${r==="dark"?"text-gray-500":"text-gray-400"}`,children:"Visual Node Source (Photo URL - Optional)"}),e.jsxs("div",{className:"relative",children:[e.jsx(P,{className:`absolute left-5 top-1/2 -translate-y-1/2 h-5 w-5 ${r==="dark"?"text-gray-700":"text-gray-300"}`}),e.jsx("input",{type:"text",placeholder:"https://assets.node/reviewer.jpg",value:a.photo_url,onChange:t=>o({...a,photo_url:t.target.value}),className:`w-full pl-14 pr-6 py-4 border-2 rounded-2xl text-sm font-mono transition-all focus:outline-none ${r==="dark"?"bg-gray-950 border-gray-800 text-white placeholder-gray-800":"bg-gray-50 border-gray-100 text-gray-900 placeholder-gray-300"}`})]})]}),e.jsxs("div",{className:"flex flex-col md:flex-row space-y-3 md:space-y-0 md:space-x-4 pt-4 border-t border-gray-100 dark:border-gray-800",children:[e.jsx("button",{onClick:()=>c(!1),className:`flex-1 py-4 rounded-2xl font-black text-[10px] uppercase tracking-widest transition-all ${r==="dark"?"text-gray-500 hover:text-white":"text-gray-400 hover:text-gray-900"}`,children:"Abort Transmission"}),e.jsx("button",{onClick:N,disabled:b,className:`flex-1 py-5 rounded-[2rem] font-black text-xs uppercase tracking-[0.2em] transition-all flex items-center justify-center space-x-3 shadow-xl ${r==="dark"?"bg-yellow-400 text-black hover:bg-yellow-500 shadow-yellow-950/20 disabled:opacity-30":"bg-red-600 text-white hover:bg-red-700 shadow-red-900/20 disabled:opacity-50"}`,children:b?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-current"}),e.jsx("span",{children:"Transmitting..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-5 w-5"}),e.jsx("span",{children:"Authorize Node"})]})})]})]})]})})]})};export{Z 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.