PageSourceSearch

https://worldofdance.com/assets/Blog-C6L92OJK.js

js worldofdance.com collected 2026-09-24 21:16:01 UTC 4,206 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-G-YrU37Q.js";import{r as l,h as y,f as S}from"./vendor-react-BM7Mjnmg.js";import{ag as C,C as o,a as c,d as m,al as k,I as _,ap as x,Q as q,z as h,s as A}from"./index-CNMWMAwp.js";import{S as P}from"./SimpleNavigation-DGIrGLml.js";import{S as T}from"./search-B1PTNep5.js";import{C as E}from"./clock-CT5aZ070.js";import{f as I}from"./format-BW1SXj1b.js";import"./vendor-supabase-z-MrzYB5.js";import"./vendor-query-DVwyB0sA.js";import"./arrow-left-4ii7lShs.js";import"./house-Cjf-5B57.js";import"./en-US-BbF3ovc9.js";function J(){const{t:r}=C(),[d,u]=l.useState([]),[g,p]=l.useState(!0),[i,f]=y(),[t,j]=l.useState(i.get("q")||""),N=S(),b=async()=>{try{let s=A.from("articles").select("*").eq("status","published").order("published_at",{ascending:!1});t&&(s=s.or(`title.ilike.%${t}%,excerpt.ilike.%${t}%`));const{data:a,error:n}=await s;if(n)throw n;u(a||[])}catch(s){console.error("Error fetching articles:",s)}finally{p(!1)}};l.useEffect(()=>{b()},[t]);const v=s=>{s.preventDefault();const a=new URLSearchParams(i);t?a.set("q",t):a.delete("q"),f(a)},w=s=>{N(`/blog/${s}`)};return g?e.jsx("div",{className:"min-h-screen bg-background",children:e.jsx("div",{className:"container mx-auto px-4 py-8",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[...Array(6)].map((s,a)=>e.jsxs(o,{className:"overflow-hidden",children:[e.jsx("div",{className:"w-full h-48 bg-muted animate-pulse"}),e.jsxs(c,{children:[e.jsx("div",{className:"h-6 bg-muted animate-pulse rounded"}),e.jsx("div",{className:"h-4 bg-muted animate-pulse rounded w-3/4"})]}),e.jsx(m,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-muted animate-pulse rounded"}),e.jsx("div",{className:"h-4 bg-muted animate-pulse rounded w-5/6"})]})})]},a))})})}):e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(k,{}),e.jsx(P,{}),e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-4xl font-bold mb-4",children:r("blog.title")}),e.jsx("p",{className:"text-xl text-muted-foreground mb-8",children:r("blog.subtitle")}),e.jsx("form",{onSubmit:v,className:"max-w-md mx-auto",children:e.jsxs("div",{className:"relative",children:[e.jsx(T,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4"}),e.jsx(_,{type:"text",placeholder:r("blog.searchPlaceholder"),value:t,onChange:s=>j(s.target.value),className:"pl-10"})]})})]}),d.length===0?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-muted-foreground",children:r(t?"blog.noResults":"blog.noArticles")})}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:d.map(s=>e.jsxs(o,{className:"overflow-hidden cursor-pointer hover:shadow-lg transition-shadow",onClick:()=>w(s.slug),children:[s.featured_image_url&&e.jsx("div",{className:"w-full h-48 overflow-hidden",children:e.jsx("img",{src:s.featured_image_url,alt:s.title,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-300"})}),e.jsxs(c,{children:[e.jsx("h2",{className:"text-xl font-semibold line-clamp-2",children:e.jsx(x,{tableName:"articles",columnName:"title",recordId:s.id,fallbackContent:s.title})}),e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(q,{className:"w-3 h-3"}),I(new Date(s.published_at),"MMM d, yyyy")]}),s.read_time&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(E,{className:"w-3 h-3"}),s.read_time," ",r("blog.minRead")]})]})]}),e.jsxs(m,{children:[s.excerpt&&e.jsx(x,{tableName:"articles",columnName:"excerpt",recordId:s.id,fallbackContent:s.excerpt||"",className:"text-muted-foreground line-clamp-3 mb-4",as:"p"}),s.tags&&s.tags.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.tags.slice(0,3).map(a=>e.jsx(h,{variant:"secondary",className:"text-xs",children:a},a)),s.tags.length>3&&e.jsxs(h,{variant:"outline",className:"text-xs",children:["+",s.tags.length-3," ",r("home.more")]})]})]})]},s.id))})]})]})}export{J 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.