PageSourceSearch

https://zafiri.com/assets/Creative-Bo7mrHg9.js

js zafiri.com collected 2026-09-25 09:51:06 UTC 3,467 bytes, 1 lines download raw bytes

1import{j as t}from"./vendor-query-Cd1K-a1f.js";import{r as i}from"./vendor-react-BrtDVGEF.js";import{c as y,b as S,u as w,S as L,H as _,I as b,D as A,F as E}from"./index-T3jWWUEU.js";import{u as I}from"./usePages-DtoxT6iV.js";import{S as D,a as F,b as M,c as $,d as h}from"./select-BF8Jdk2g.js";import{d as H}from"./vendor-icons-BKHJKxwD.js";import"./vendor-radix-C_0uraVY.js";import"./vendor-supabase-Bvq1Btpc.js";import"./vendor-charts-BfMOMpwd.js";const Z=()=>{const{data:m,isLoading:u}=y("published"),{categories:p}=S(!1),{isAdmin:f}=w(),{data:a}=I("creative"),[r,g]=i.useState(""),[l,v]=i.useState("all"),c=p.find(e=>e.slug==="creative"),n=i.useMemo(()=>!c||!m?[]:m.filter(e=>e.category_id===c.id||(e.category_ids||[]).includes(c.id)),[m,c]),x=i.useMemo(()=>{const e=new Set;return n.forEach(s=>{s.location_name&&e.add(s.location_name)}),Array.from(e).sort()},[n]),d=i.useMemo(()=>{let e=n;if(r.trim()){const s=r.toLowerCase();e=e.filter(o=>o.title.toLowerCase().includes(s)||o.excerpt&&o.excerpt.toLowerCase().includes(s)||o.location_name&&o.location_name.toLowerCase().includes(s))}return l!=="all"&&(e=e.filter(s=>s.location_name===l)),e},[n,r,l]),j=(a==null?void 0:a.meta_title)||"Creative - Zafiri",C=(a==null?void 0:a.meta_description)||"Creative inspiration and stories for endurance athletes.",N=i.useMemo(()=>({"@context":"https://schema.org","@type":"ItemList",name:"Creative stories",itemListElement:d.slice(0,50).map((e,s)=>({"@type":"ListItem",position:s+1,url:`https://www.zafiri.com/${e.slug}`,name:e.title,...e.excerpt?{description:e.excerpt}:{}}))}),[d]);return t.jsxs("div",{className:"min-h-screen bg-background",children:[t.jsx(L,{title:j,description:C,jsonLd:N}),t.jsx(_,{}),t.jsxs("main",{className:"container px-2 sm:px-4 py-12",children:[t.jsxs("div",{className:"mb-10 text-center",children:[t.jsx("h1",{className:"mb-3 text-4xl font-bold text-foreground",children:"Creative"}),t.jsx("p",{className:"text-lg text-muted-foreground",children:(a==null?void 0:a.excerpt)||"Creative inspiration and stories for endurance athletes"})]}),t.jsxs("div",{className:"mb-8 flex flex-col sm:flex-row gap-3 max-w-2xl mx-auto",children:[t.jsxs("div",{className:"relative flex-1",children:[t.jsx(H,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),t.jsx(b,{placeholder:"Search creative…",value:r,onChange:e=>g(e.target.value),className:"pl-9"})]}),x.length>0&&t.jsxs(D,{value:l,onValueChange:v,children:[t.jsx(F,{className:"w-full sm:w-[200px]",children:t.jsx(M,{placeholder:"All locations"})}),t.jsxs($,{children:[t.jsx(h,{value:"all",children:"All locations"}),x.map(e=>t.jsx(h,{value:e,children:e},e))]})]})]}),u&&t.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:Array.from({length:8}).map((e,s)=>t.jsx("div",{className:"h-80 animate-pulse rounded-xl bg-muted"},s))}),!u&&t.jsxs("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[d.map((e,s)=>t.jsx("div",{className:"animate-fade-in",style:{animationDelay:`${s*100}ms`},children:t.jsx(A,{title:e.title,category:"Creative",description:e.excerpt||"",location:"",image:e.featured_image_url||void 0,link:`/${e.slug}`,editUrl:f?`/admin/posts?edit=${e.id}`:void 0})},e.id)),d.length===0&&t.jsx("p",{className:"col-span-full text-center text-muted-foreground py-12",children:r||l!=="all"?"No posts match your search.":"No creative posts found yet."})]})]}),t.jsx(E,{})]})};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.