1import{i as e,n as t,t as n}from"./jsx-runtime-CY_MMzgk.js";import{Y as r,et as i}from"./index-B8oWIqVZ.js";import{t as a}from"./product-image-mjdNlrcS.js";import{n as o,t as s}from"./card-Cyrc02TS.js";var c=e(t()),l=n();function u({src:e,alt:t}){let[n,r]=(0,c.useState)(`loading`);return(0,l.jsxs)(l.Fragment,{children:[n===`loading`&&(0,l.jsx)(`div`,{className:`absolute inset-0 z-10 grid place-items-center bg-secondary`,children:(0,l.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,l.jsx)(`span`,{className:`inline-block h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent`}),`Cargandoâ¦`]})}),(0,l.jsx)(`img`,{src:e,alt:t,className:`h-full w-full object-cover transition-opacity duration-500 ${n===`loaded`?`opacity-100`:`opacity-0`}`,loading:`lazy`,decoding:`async`,onLoad:()=>r(`loaded`),onError:()=>r(`error`)}),n===`error`&&(0,l.jsx)(`div`,{className:`absolute inset-0 z-10 grid place-items-center bg-secondary text-xs text-muted-foreground`,children:`No se pudo cargar la imagen`})]})}function d(){let[e,t]=(0,c.useState)([]);return(0,c.useEffect)(()=>{r.from(`blog_posts`).select(`id,slug,title,excerpt,image_url,published_at`).order(`published_at`,{ascending:!1}).then(({data:e})=>t(e??[]))},[]),(0,l.jsxs)(`div`,{className:`mx-auto max-w-7xl px-4 py-12 sm:px-6`,children:[(0,l.jsx)(`h1`,{className:`font-serif text-3xl sm:text-4xl`,children:`Blog`}),(0,l.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:`Consejos, técnicas y novedades del mundo del bowling.`}),(0,l.jsx)(`div`,{className:`mt-8 grid gap-6 sm:grid-cols-2 lg:grid-cols-3`,children:e.map(e=>(0,l.jsx)(i,{to:`/blogs/$slug`,params:{slug:e.slug},className:`group`,children:(0,l.jsxs)(s,{className:`h-full overflow-hidden border-border/60 transition-shadow group-hover:shadow-lg`,children:[(0,l.jsx)(`div`,{className:`relative aspect-[16/10] bg-secondary`,children:e.image_url?(0,l.jsx)(u,{src:e.image_url,alt:e.title}):(0,l.jsx)(`div`,{className:`grid h-full place-items-center bg-gradient-to-br from-maroon to-maroon/60 text-gold`,children:(0,l.jsx)(`span`,{className:`font-serif text-2xl`,children:`StudProShop`})})}),(0,l.jsxs)(o,{className:`p-5`,children:[(0,l.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted-foreground`,children:a(e.published_at)}),(0,l.jsx)(`h2`,{className:`mt-1 font-serif text-xl group-hover:text-maroon`,children:e.title}),e.excerpt&&(0,l.jsx)(`p`,{className:`mt-2 line-clamp-3 text-sm text-muted-foreground`,children:e.excerpt})]})]})},e.id))}),e.length===0&&(0,l.jsxs)(`div`,{className:`mt-12 flex flex-col items-center justify-center gap-3 text-center`,children:[(0,l.jsx)(`p`,{className:`text-lg font-medium text-foreground`,children:`Pronto más información y contenido.`}),(0,l.jsx)(`p`,{className:`text-2xl font-bold uppercase tracking-wider text-maroon`,children:`¡ESPERALO!`})]})]})}export{d as component};
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.