1import{r as l,j as e}from"./react-vendor-CwPMIhXX.js";import{s as x}from"./client-nSocIZns.js";import{G as u}from"./index-BlueuAAU.js";import{E as g,v as f,S as p}from"./icons-CEMxximl.js";import"./vendor-BiNnEn2v.js";import"./supabase-B2sTV2cx.js";import"./query-DxKQORNk.js";import"./router-CSDO9dMQ.js";import"./toast-C1JzTdn7.js";import"./radix-BqmtYzyb.js";function d({rating:t,label:o}){return e.jsx("div",{className:"flex items-center gap-0.5",role:"img","aria-label":o,children:Array.from({length:5}).map((n,a)=>e.jsx(p,{className:`w-4 h-4 ${a<Math.round(t)?"fill-amber-400 text-amber-400":"text-muted-foreground/30"}`,"aria-hidden":"true"},a))})}const k=()=>{const[t,o]=l.useState(null),[n,a]=l.useState(!1),[c,m]=l.useState({});return l.useEffect(()=>{let r=!0;return x.functions.invoke("google-reviews").then(({data:s,error:i})=>{if(r){if(i||!s?.reviews?.length){a(!0);return}o(s)}}).catch(()=>r&&a(!0)),()=>{r=!1}},[]),n||!t?null:e.jsx("section",{id:"avis-google","aria-labelledby":"avis-google-title",className:"py-16 lg:py-24 bg-muted/40",children:e.jsxs("div",{className:"container",children:[e.jsxs("div",{className:"text-center max-w-2xl mx-auto",children:[e.jsx("span",{className:"text-sm font-semibold text-primary uppercase tracking-wider",children:"Avis Google vérifiés"}),e.jsxs("h2",{id:"avis-google-title",className:"mt-3 text-3xl md:text-4xl font-bold text-foreground text-balance",children:["Ce que disent nos clients"," ",e.jsx("span",{className:"text-primary",children:"sur Google"})]}),e.jsxs("div",{className:"mt-6 inline-flex items-center gap-3 rounded-full border border-border bg-card px-5 py-2.5",children:[e.jsx("span",{className:"text-2xl font-bold text-foreground",children:t.rating.toFixed(1)}),e.jsx(d,{rating:t.rating,label:`Note ${t.rating} sur 5`}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:[t.reviewCount," avis"]})]})]}),e.jsx("ul",{className:"mt-12 grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:t.reviews.slice(0,6).map((r,s)=>e.jsxs("li",{className:"flex flex-col rounded-xl border border-border bg-card p-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r.photo&&!c[s]?e.jsx("img",{src:r.photo,alt:"",width:40,height:40,loading:"lazy",referrerPolicy:"no-referrer",onError:()=>m(i=>({...i,[s]:!0})),className:"w-10 h-10 rounded-full object-cover"}):e.jsx("span",{"aria-hidden":"true",className:"w-10 h-10 rounded-full bg-primary/10 text-primary font-semibold flex items-center justify-center",children:r.author.charAt(0)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground truncate",children:r.author}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.relativeTime})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx(d,{rating:r.rating,label:`${r.rating} étoiles sur 5`})}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground leading-relaxed line-clamp-6",children:r.text})]},s))}),e.jsxs("div",{className:"mt-10 flex flex-col sm:flex-row items-center justify-center gap-4",children:[t.mapsUri&&e.jsxs("a",{href:t.mapsUri,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-lg bg-primary text-primary-foreground font-semibold text-sm hover:bg-primary/90 transition-colors",children:["Voir tous les avis Google",e.jsx(g,{className:"w-4 h-4","aria-hidden":"true"})]}),e.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-lg border border-border bg-card text-foreground font-semibold text-sm hover:border-primary/40 hover:text-primary transition-colors",children:[e.jsx(f,{className:"w-4 h-4","aria-hidden":"true"}),"Voir notre fiche Google"]})]})]})})};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.