PageSourceSearch

https://liquidbounce.net/assets/overview-C3IGPgwA.js

js liquidbounce.net collected 2026-09-24 09:47:41 UTC 8,004 bytes, 6 lines download raw bytes

1import{w as $}from"./with-props-CFCTPvbg.js";import{h as F,a as R,u as B,i as q,r as d,j as e,L as x}from"./chunk-D4RADZKF-BJ5MSu0N.js";import{C as j,a as y}from"./Card-tuhV4Y2j.js";import{S as w}from"./search-Cwj4ySo3.js";import{I as U}from"./Input-9cl-yLVs.js";import{B as o,b as E}from"./Button-DCPtXYp_.js";import{c as M,X as p}from"./x-BVQjsxq4.js";import{T as h,H as S}from"./Typography-B3TOvgoz.js";import{B as C}from"./DataDisplay-ClYqhDG7.js";import{C as A}from"./calendar-B6pzMQzP.js";import{p as H,E as I}from"./eye-BjkVNJSL.js";import{C as O}from"./chevron-left-CpWiuUD-.js";import{C as Q}from"./chevron-right-1y0DMA1C.js";import{f as T}from"./format-CLsMnXZy.js";import"./utils-CytzSlOG.js";import"./index-CyLcmhXl.js";import"./getTimezoneOffsetInMilliseconds-BcGZcdus.js";import"./en-US-ClfMaaVW.js";import"./differenceInCalendarDays-CXi0v9iC.js";/**
2 * @license lucide-react v0.368.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const V=M("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),xe=$(function(){const{categories:n}=F(),[s,v]=R(),{blogData:k,currentParams:l}=B(),c=q(),[u,f]=d.useState(l.query),[i,g]=d.useState(l.category),[m,z]=d.useState(!1),N=d.useMemo(()=>{var r;return i>0&&n?((r=n.find(a=>a.category_id===i))==null?void 0:r.name)??null:null},[i,n]),P=r=>{r.preventDefault();const a=new URLSearchParams;u&&a.set("query",u),i>0&&a.set("category",i.toString()),c(`/blog?${a.toString()}`)},L=r=>{const a=new URLSearchParams(s);a.set("page",r.toString()),c(`/blog?${a.toString()}`)},b=r=>{g(r);const a=new URLSearchParams(s);r>0?a.set("category",r.toString()):a.delete("category"),a.delete("page"),c(`/blog?${a.toString()}`)},_=()=>{f(""),g(0),c("/blog")};return e.jsxs("div",{className:"space-y-8",children:[e.jsx(j,{children:e.jsx(y,{className:"p-6",children:e.jsxs("form",{onSubmit:P,className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col md:flex-row items-stretch gap-4 w-full",children:[e.jsxs("div",{className:"relative w-full md:flex-1",children:[e.jsx(w,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-zinc-500"}),e.jsx(U,{type:"text",placeholder:"Search articles by title, content, or author...",value:u,onChange:r=>f(r.target.value),className:"pl-10 h-12 text-base w-full"})]}),e.jsxs("div",{className:"flex gap-2 justify-between md:justify-end md:flex-none",children:[e.jsx(o,{type:"submit",variant:"brand",className:"shrink-0 h-12 px-6 border",children:"Search"}),e.jsxs(o,{type:"button",variant:"outline",className:"shrink-0 h-12 border border-border",onClick:()=>z(!m),children:[m?e.jsx(p,{className:"h-5 w-5"}):e.jsx(V,{className:"h-5 w-5"}),e.jsx("span",{className:"ml-2 hidden md:inline",children:m?"Hide Filters":"Filters"})]})]})]}),(l.query||l.category>0)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-2",children:[e.jsx(h,{size:"sm",color:"muted",className:"mr-1",children:"Active filters:"}),l.query&&e.jsxs("div",{className:"flex items-center",children:[e.jsxs(C,{variant:"default",className:"flex items-center gap-1 px-3 py-1",children:[e.jsx(w,{className:"h-3 w-3"}),l.query]}),e.jsx("button",{type:"button",onClick:()=>{f("");const r=new URLSearchParams(s);r.delete("query"),c(`/blog?${r.toString()}`)},className:"ml-1 p-1 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-full",children:e.jsx(p,{className:"h-3 w-3"})})]}),N&&e.jsxs("div",{className:"flex items-center",children:[e.jsxs(C,{variant:"default",className:"flex items-center gap-1 px-3 py-1",children:["Category: ",N]}),e.jsx("button",{type:"button",onClick:()=>{g(0);const r=new URLSearchParams(s);r.delete("category"),c(`/blog?${r.toString()}`)},className:"ml-1 p-1 hover:bg-zinc-100 dark:hover:bg-zinc-800 rounded-full",children:e.jsx(p,{className:"h-3 w-3"})})]}),e.jsx(o,{variant:"ghost",size:"sm",onClick:_,className:"text-brand hover:text-blue-800 dark:hover:text-blue-300",children:"Clear all filters"})]}),m&&e.jsx("div",{className:"pt-4 border-t border-border mt-4",children:e.jsx("div",{className:"py-4",children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>b(0),className:`px-3 py-1 rounded-full text-xs font-medium ring-1 ring-inset ${i===0?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400 ring-green-600/20":"bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-zinc-300 ring-zinc-500/10"} hover:opacity-90 transition-opacity`,children:"All Categories"}),n.map(r=>e.jsx("button",{type:"button",onClick:()=>b(r.category_id),className:`px-3 py-1 rounded-full text-xs font-medium ring-1 ring-inset ${i===r.category_id?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400 ring-green-600/20":"bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-zinc-300 ring-zinc-500/10"} hover:opacity-90 transition-opacity`,children:r.name},r.category_id))]})})})]})})}),e.jsx("div",{children:e.jsx(X,{blogData:k,handlePageChange:L})})]})});function X({blogData:t,handlePageChange:n}){return!t||t.items.length===0?e.jsx(j,{children:e.jsxs(y,{className:"p-8 text-center",children:[e.jsx(h,{size:"lg",className:"mb-4",children:"No blog posts found matching your criteria."}),e.jsx(x,{className:E(),to:"/blog",children:"Clear filters"})]})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-6 flex justify-between items-center",children:e.jsx(S,{size:"xl",children:t.pagination.items===0?"No articles found":t.pagination.items===1?"1 article found":`${t.pagination.items} articles found`})}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8",children:t.items.map(s=>e.jsxs(j,{className:"overflow-hidden flex flex-col h-full hover:shadow-md transition-shadow",children:[e.jsx(x,{to:`/blog/article/${s.post_uid}`,className:"block h-48 overflow-hidden",children:e.jsx("img",{src:s.preview_image_url,alt:s.title,className:"w-full h-full object-cover transition-transform hover:scale-105",loading:"lazy",decoding:"async"})}),e.jsxs(y,{className:"p-6 flex-1 flex flex-col",children:[e.jsxs("div",{className:"flex items-center text-sm text-foreground-secondary mb-2 gap-4",children:[e.jsxs("span",{className:"flex items-center",children:[e.jsx(A,{className:"h-4 w-4 mr-1"}),T(H(s.date),"MMM d, yyyy")]}),e.jsxs("span",{className:"flex items-center",children:[e.jsx(I,{className:"h-4 w-4 mr-1"}
6),s.views.toLocaleString()]})]}),e.jsx(x,{to:`/blog/article/${s.post_uid}`,className:"group",children:e.jsx(S,{size:"lg",className:"mb-2 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:s.title})}),e.jsx(h,{className:"mb-4 line-clamp-3",children:s.description}),e.jsxs("div",{className:"mt-auto flex items-center justify-between",children:[e.jsxs(h,{size:"sm",className:"font-medium",children:["By ",s.author]}),e.jsx(x,{to:`/blog/article/${s.post_uid}`,className:"text-brand text-sm font-medium hover:underline",children:"Read more"})]})]})]},s.post_uid))}),t.pagination.pages>1&&e.jsx("div",{className:"flex justify-center mt-10",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs(o,{variant:"outline",size:"sm",disabled:t.pagination.current<=1,onClick:()=>n(t.pagination.current-1),children:[e.jsx(O,{className:"h-4 w-4 mr-1"}),"Previous"]}),e.jsx("div",{className:"flex items-center mx-2",children:Array.from({length:t.pagination.pages},(s,v)=>v+1).map(s=>s===1||s===t.pagination.pages||s>=t.pagination.current-1&&s<=t.pagination.current+1?e.jsx(o,{variant:s===t.pagination.current?"default":"outline",size:"sm",className:"mx-1 min-w-8",onClick:()=>n(s),children:s},s):s===t.pagination.current-2&&s>1||s===t.pagination.current+2&&s<t.pagination.pages?e.jsx("span",{className:"mx-1",children:"..."},s):null)}),e.jsxs(o,{variant:"outline",size:"sm",disabled:t.pagination.current>=t.pagination.pages,onClick:()=>n(t.pagination.current+1),children:["Next",e.jsx(Q,{className:"h-4 w-4 ml-1"})]})]})})]})}export{xe 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.