1import{r as a,j as e,L as $}from"./react-vendor-o-62gUsK.js";import{u as P,s as I,P as z,I as A,B as N,S as D}from"./index-BxebFInA.js";import{F}from"./ServiceBlocks-Cj1prMP5.js";import{u as L}from"./useDebounce-DB2szdBP.js";import{f as B,g as O,h as T,i as q,j as G}from"./icons-CuqSVQ6h.js";import"./tanstack-bfvW12lo.js";import"./supabase-L9V-I8OX.js";const _=6;function M(s){const b=["ticketing","digital","travel","broken","practical","hopeless","legacy","AI","React Native","security","accessibility","monitoring","offshore","fragmentation","testing","load","threading","vibe","cost","Netflix","brownfield","rejection","compatibility"];for(const d of b){const x=new RegExp(`(${d})`,"i"),i=s.match(x);if(i&&i.index!==void 0){const v=s.slice(0,i.index),o=i[1],g=s.slice(i.index+o.length);return e.jsxs(e.Fragment,{children:[v,e.jsx("span",{className:"text-secondary",children:o}),g]})}}return s}function U(s){return new Date(s).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function Y(){const[s,b]=a.useState([]),[d,x]=a.useState(1),[i,v]=a.useState(0),[o,g]=a.useState(!1),k=a.useRef(null),[S,C]=a.useState(""),[n,p]=a.useState(null),[w,R]=a.useState([]),f=L(S,300);return P({title:"Insights â App Strategy & Brownfield Recovery | Indiespring",description:"Read our news from the market, opinion pieces and Indiespring updates here.",canonical:"https://indiespring.com/insights",structuredData:{"@context":"https://schema.org","@type":"Blog",url:"https://indiespring.com/insights",name:"Indiespring Insights",publisher:{"@type":"Organization",name:"Indiespring",url:"https://indiespring.com"}}}),a.useEffect(()=>{(async()=>{const{data:t}=await I.from("categories").select("id, name").order("name");R(t??[])})()},[]),a.useEffect(()=>{x(1)},[f,n]),a.useEffect(()=>{let t=!1;return(async()=>{g(!0);const l=(d-1)*_,m=l+_-1;let r=I.from("insight_posts").select("id, title, slug, excerpt, featured_image, featured_image_alt, published_at, read_time, authors:author_id(name, avatar_url), categories:category_id(name)",{count:"exact"}).eq("status","published").order("published_at",{ascending:!1}).range(l,m);if(f){const h=`%${f}%`;r=r.or(`title.ilike.${h},excerpt.ilike.${h}`)}n&&(r=r.eq("category_id",n));const{data:c,count:j}=await r;if(t)return;const u=c??[];v(j??0),b(h=>{if(d===1)return u;const E=new Set(h.map(y=>y.id));return[...h,...u.filter(y=>!E.has(y.id))]}),g(!1)})(),()=>{t=!0}},[d,f,n]),a.useEffect(()=>{const t=k.current;if(!t)return;const l=new IntersectionObserver(m=>{m[0].isIntersecting&&!o&&s.length<i&&x(r=>r+1)},{rootMargin:"600px 0px"});return l.observe(t),()=>l.disconnect()},[o,s.length,i]),e.jsxs(z,{children:[e.jsx("section",{className:"pt-28 md:pt-36",children:e.jsx("div",{className:"container",children:e.jsxs("div",{className:"pb-8 md:pb-10",children:[e.jsx("h1",{className:"text-4xl font-bold leading-[1.05] tracking-tight md:text-6xl",children:"Insights"}),e.jsx("p",{className:"mt-5 max-w-xl text-base leading-relaxed text-muted-foreground md:text-lg",children:"News from the market, opinion pieces and Indiespring updates."})]})})}),e.jsx("section",{className:"pb-6 pt-4 md:pt-6",children:e.jsxs("div",{className:"container space-y-4",children:[e.jsxs("div",{className:"relative max-w-md",children:[e.jsx(B,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(A,{placeholder:"Search articles...",value:S,onChange:t=>C(t.target.value),className:"pl-10"})]}),w.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"-mx-[var(--container-px,1.5rem)] flex gap-2 overflow-x-auto px-[var(--container-px,1.5rem)] pb-1 [scrollbar-width:none] md:hidden [&::-webkit-scrollbar]:hidden",children:[e.jsx(N,{size:"sm",variant:n===null?"default":"outline",onClick:()=>p(null),className:"shrink-0",children:"All"}),w.map(t=>e.jsx(N,{size:"sm",variant:n===t.id?"default":"outline",onClick:()=>p(n===t.id?null:t.id),className:"shrink-0",children:t.name},t.id))]}),e.jsxs("div",{className:"hidden flex-wrap gap-2 md:flex",children:[e.jsx(N,{size:"sm",variant:n===null?"default":"outline",onClick:()=>p(null),children:"All"}),w.map(t=>e.jsx(N,{size:"sm",variant:n===t.id?"default":"outline",onClick:()=>p(n===t.id?null:t.id),children:t.name},t.id))]})]})]})}),e.jsxs("section",{className:"pb-16 pt-6 md:pb-24 md:pt-10",children:[e.jsxs("div",{className:"container",children:[s.length===0&&e.jsx("p",{className:"py-12 text-center text-muted-foreground",children:"No articles found."}),e.jsx("div",{className:"grid items-stretch gap-6 md:grid-cols-2 lg:grid-cols-3",children:s.map((t,l)=>{var j,u;const m=Math.floor(l/5),r=l%5,c=m%2===0?r===0:r===1;return e.jsx(D,{delay:l%_*60,className:`h-full ${c?"md:col-span-2":""}`,children:e.jsxs($,{to:`/insights/${t.slug}`,className:"group flex h-full flex-col overflow-hidden rounded-[8px] border border-border bg-card transition-shadow duration-300 hover:shadow-[var(--shadow-md)] md:rounded-[8px_8px_8px_80px]",children:[e.jsx("div",{className:"relative w-full overflow-hidden bg-background",children:t.featured_image?e.jsx("img",{src:t.featured_image,alt:t.featured_image_alt||t.title,className:`${c?"md:aspect-[21/9] md:object-cover":""} h-auto w-full transition-transform duration-300 group-hover:scale-[1.03]`,loading:"lazy"}):e.jsx("div",{className:`${c?"md:aspect-[21/9]":"aspect-[16/10]"} w-full bg-muted`})}),e.jsxs("div",{className:"flex flex-1 flex-col p-4 md:p-6 md:pb-10 md:pl-10",children:[e.jsx("h2",{className:`text-base font-bold leading-snug ${c?"md:text-2xl":"md:text-xl"}`,children:M(t.title)}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground md:mt-3",children:[((j=t.authors)==null?void 0:j.name)&&e.jsxs("span",{className:"hidden items-center gap-1.5 md:flex",children:[t.authors.avatar_url?e.jsx("img",{src:t.authors.avatar_url,alt:t.authors.name,className:"h-5 w-5 rounded-full object-cover"}):e.jsx(O,{className:"h-3.5 w-3.5"}),t.authors.name]}),t.published_at&&e.jsxs("span",{className:"hidden items-center gap-1.5 md:flex",children:[e.jsx(T,{className:"h-3.5 w-3.5"}),U(t.published_at)]}),((u=t.categories)==null?void 0:u.name)&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-accent-orange",children:"{"}),t.categories.name,e.jsx("span",{className:"text-accent-orange",children:"}"})]}),t.read_time&&e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(q,{className:"h-3.5 w-3.5"}),t.read_time," min read"]})]}),e.jsx("p",{className:"mt-4 hidden text-sm leading-relaxed text-muted-foreground line-clamp-3 md:block",children:t.excerpt}),e.jsxs("span",{className:"mt-auto flex items-center gap-1 pt-2 text-sm font-medium text-accent-orange md:hidden",children:["Read article ",e.jsx(G,{className:"h-4 w-4"})]})]})]})},t.id)})})]}),s.length<i&&e.jsx("div",{ref:k,className:"mt-14 flex justify-center","aria-live":"polite",children:e.jsx("span",{className:"text-sm text-muted-foreground",children:o?"Loading more articlesâ¦":""})})]}),e.jsx(F,{heading:"Working through something {complicated}?",body:"Our insights come from real inherited estates. If any of this sounds familiar, tell us what you're dealing with.",ctaText:"Start a conversation"})]})}
1export{Y 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.