1import{d as m,r as f,j as e,L as i}from"./main-Bo0oayNO.js";import"./country-visa-Cppajoww.js";import{P as j}from"./PostCard-DUwjTgtE.js";import{P as v}from"./Pagination-DVpyy6RE.js";import"./HomepageSections-4WnTbsUT.js";import{B as y}from"./BlogLayout-Zr1of7og.js";import"./ui-utils-CNoARbDA.js";import"./PageLayout-BjI6KKxV.js";import"./Header-Ba4WgGVg.js";function M(){const{posts:l,pagination:c,siteTitle:p,allCategories:x,allTags:h,activeCategory:r,activeTag:o,searchQuery:a}=m.useLoaderData(),t=m.useSearch(),[k,d]=f.useState(a||""),u=s=>{const n=new URLSearchParams;t.category&&n.set("category",t.category),t.tag&&n.set("tag",t.tag),s.trim()&&n.set("q",s.trim());const g=n.toString();window.location.href=g?`/posts?${g}`:"/posts"};return e.jsx(y,{siteTitle:p,categories:x,tags:h,activeCategory:t.category,activeTag:t.tag,searchQuery:a,onSearch:u,children:e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground mb-4 font-heading",children:"Articles"}),(r||o||a)&&e.jsxs("div",{className:"flex items-center gap-2 mb-6 flex-wrap",children:[e.jsx("span",{className:"text-sm text-foreground-muted",children:"Filtering by:"}),a&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm font-medium bg-primary/10 text-primary",children:['Search: "',a,'"',e.jsx(i,{to:"/posts",search:{page:void 0,category:t.category,tag:t.tag,q:void 0},className:"ml-1 hover:text-primary-dark",onClick:()=>d(""),children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),r&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm font-medium bg-accent/10 text-accent",children:["Category: ",r,e.jsx(i,{to:"/posts",search:{page:void 0,category:void 0,tag:t.tag,q:t.q},className:"ml-1 hover:text-accent-dark",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),o&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-3 py-1 rounded-full text-sm font-medium bg-foreground
1/10 text-foreground",children:["Tag: #",o,e.jsx(i,{to:"/posts",search:{page:void 0,category:t.category,tag:void 0,q:t.q},className:"ml-1 hover:text-foreground-muted",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e.jsx(i,{to:"/posts",search:{page:void 0,category:void 0,tag:void 0,q:void 0},className:"text-sm text-foreground-muted hover:text-foreground underline",onClick:()=>d(""),children:"Clear all"})]}),l.length===0?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-foreground-muted",children:a||r||o?"No posts found matching your search.":"No posts yet. Check back later!"})}):e.jsx("div",{className:"space-y-6",children:l.map(s=>e.jsx(j,{post:s},s.id))}),c.totalPages>1&&e.jsx("div",{className:"mt-12",children:e.jsx(v,{currentPage:c.page,totalPages:c.totalPages,basePath:"/posts",searchParams:{category:t.category,tag:t.tag,q:t.q}})})]})})}export{M 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.