PageSourceSearch

https://espacoolinda.com.br/assets/InstagramGallery-C4s8L2Q_.js

js espacoolinda.com.br collected 2026-09-30 06:38:36 UTC 4,533 bytes, 1 lines download raw bytes

1import{r as o,j as e,B as k,a7 as J}from"./index-qbwSSzHC.js";import{I as c}from"./instagram-CutfphEW.js";import{E as Y}from"./external-link-pLey_AXC.js";import{H as C}from"./heart-DGEial_W.js";const X=({title:d="Veja no nosso Instagram",subtitle:m="Os momentos mais marcantes dos eventos no Espaço Olinda — direto do nosso feed.",limit:n=8,columns:f=4,compact:u=!1,fallbackImages:t,handle:l="espacoolinda"})=>{const[h,j]=o.useState([]),[I,v]=o.useState(!0),[y,x]=o.useState(!0);if(o.useEffect(()=>{let s=!1;return(async()=>{try{const i=`https://xgzicdsdajdwazetiolm.supabase.co/functions/v1/instagram-feed?limit=${n}`,r=await(await fetch(i,{headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhnemljZHNkYWpkd2F6ZXRpb2xtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTk3NzQ4MTUsImV4cCI6MjA3NTM1MDgxNX0.8YzTYQzbs76Ja8OmQtfpudYwW_Y0cKExd4zCYiI77dU",apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhnemljZHNkYWpkd2F6ZXRpb2xtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTk3NzQ4MTUsImV4cCI6MjA3NTM1MDgxNX0.8YzTYQzbs76Ja8OmQtfpudYwW_Y0cKExd4zCYiI77dU"}})).json();if(s)return;r&&r.configured===!1?(x(!1),j([])):r!=null&&r.media&&(j(r.media.slice(0,n)),x(!0))}catch(i){console.warn("[InstagramGallery] failed to load:",i),x(!1)}finally{s||v(!1)}})(),()=>{s=!0}},[n]),!y&&(!t||t.length===0))return null;const g=f===6?"grid-cols-2 md:grid-cols-3 lg:grid-cols-6":f===3?"grid-cols-2 md:grid-cols-3":"grid-cols-2 md:grid-cols-3 lg:grid-cols-4",b=()=>e.jsx("div",{className:`grid ${g} gap-3 md:gap-4`,children:t.slice(0,n).map((s,a)=>e.jsxs("a",{href:`https://instagram.com/${l}`,target:"_blank",rel:"noopener noreferrer",className:"group relative aspect-square overflow-hidden rounded-xl bg-muted",children:[e.jsx("img",{src:s.src,alt:s.alt,loading:"lazy",decoding:"async",className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/80 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex items-end p-3",children:e.jsx(c,{className:"w-5 h-5 text-foreground"})})]},a))}),w=()=>e.jsx("div",{className:`grid ${g} gap-3 md:gap-4`,children:Array.from({length:n}).map((s,a)=>e.jsx("div",{className:"aspect-square rounded-xl bg-muted animate-pulse"},a))}),z=()=>e.jsx("div",{className:`grid ${g} gap-3 md:gap-4`,children:h.map(s=>{var p;const a=s.media_type==="VIDEO"?s.thumbnail_url:s.media_url,i=((p=s.caption)==null?void 0:p.slice(0,120))||"Foto do Instagram do Espaço Olinda";return e.jsxs("a",{href:s.permalink,target:"_blank",rel:"noopener noreferrer",className:"group relative aspect-square overflow-hidden rounded-xl bg-muted",children:[a&&e.jsx("img",{src:a,alt:i,loading:"lazy",decoding:"async",className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background/90 via-background/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col justify-end p-3",children:e.jsxs("div",{className:"flex items-center gap-3 text-sm text-foreground",children:[typeof s.like_count=="number"&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(C,{className:"w-4 h-4"})," ",s.like_count]}),typeof s.comments_count=="number"&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(J,{className:"w-4 h-4"})," ",s.comments_count]}),e.jsx(c,{className:"w-4 h-4 ml-auto"})]})})]},s.id)})}),N=e.jsxs(e.Fragment,{children:[!u&&(d||m)&&e.jsxs("div",{className:"text-center mb-10",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 text-primary text-sm font-medium mb-3",children:[e.jsx(c,{className:"w-4 h-4"}),e.jsxs("span",{children:["@",l]})]}),d&&e.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-3",children:d}),m&&e.jsx("p",{className:"text-lg text-foreground/70 max-w-2xl mx-auto",children:m})]}),I?w():h.length>0?z():t&&t.length>0?b():null,!u&&e.jsx("div",{className:"text-center mt-8",children:e.jsx(k,{asChild:!0,variant:"outline",children:e.jsxs("a",{href:`https://instagram.com/${l}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2",children:[e.jsx(c,{className:"w-4 h-4"}),"Seguir @",l,e.jsx(Y,{className:"w-3.5 h-3.5"})]})})})]});return u?e.jsx("div",{children:N}):e.jsx("section",{className:"py-20 px-6 lg:px-8",children:e.jsx("div",{className:"max-w-7xl mx-auto",children:N})})};export{X 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.