PageSourceSearch

https://pvppcoe-va-official.vercel.app/assets/news-D1GM173f.js

js pvppcoe-va-official.vercel.app collected 2026-10-03 07:34:27 UTC 6,691 bytes, 1 lines download raw bytes

1import{j as e,R as y,c as N,r as i,b as w}from"./index-CZ63uMbh.js";import{g as v}from"./news-CdYD4OK-.js";import{N as C}from"./Navbar-vopjiuYR.js";import{F as S}from"./Footer-B0IsONm0.js";import{T as D}from"./Title-BBvpi3RY.js";import{D as _,a as L,b as T,c as A,d as k}from"./dialog--uVrPao_.js";import{T as u}from"./tag-Cqywl-di.js";import{C as h}from"./calendar-MbwWLcgf.js";import{I as F}from"./input-BC0o4X8c.js";import{S as E,a as I,b as M,c as R,d as V}from"./select-CYiFxgLe.js";import{C as O,a as P,b as Q,c as q}from"./card-eMmN0GeS.js";import{S as B}from"./search-DUJX9XjT.js";import"./new-logo-CP-bhNxg.js";import"./index-Cr2ioHNk.js";import"./index-B6kdtPCW.js";import"./index-BZncbyvf.js";import"./index-CLkq5Hps.js";import"./index-CqE-R4rq.js";import"./index-Gc50gddj.js";import"./chevron-down-DkaqlaqH.js";import"./skeleton-BR-RPoYW.js";import"./cms-CHV9TDEn.js";import"./committee-BEuSAQTy.js";import"./chevron-right-B0RAKh-j.js";import"./command-BGNsd_tZ.js";import"./accordion-BtKnvyy_.js";import"./index-wIrYzIVX.js";import"./chevron-up-D_GtNfQM.js";import"./menu-DXARzmxq.js";import"./footer-logo-CVSNQeDF.js";import"./texture-9-CgOV0NyJ.js";import"./index-DpwuUn16.js";import"./index-nl0SDQ4B.js";import"./check-BEZwni6Q.js";function H({news:s,isOpen:n,onClose:l}){if(!s)return null;const c=s.published_at?new Date(s.published_at).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):"Draft";return e.jsx(_,{open:n,onOpenChange:o=>!o&&l(),children:e.jsx(L,{className:"max-w-3xl max-h-[85vh] flex flex-col overflow-hidden p-0","data-lenis-prevent":"true",children:e.jsxs("div",{className:"overflow-y-auto overscroll-contain px-6 py-6 flex flex-col gap-6","data-lenis-prevent":"true",children:[e.jsxs(T,{className:"space-y-4",children:[s.image_url&&e.jsx("div",{className:"w-full aspect-[4/3] rounded-xl overflow-hidden mb-4 mt-2 relative shrink-0",children:e.jsx("img",{src:s.image_url,alt:s.title,className:"w-full h-full object-cover"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground shrink-0",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/10 px-3 py-1 font-semibold text-primary",children:[e.jsx(u,{className:"h-4 w-4"}),s.category]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(h,{className:"h-4 w-4"}),c]})]}),e.jsx(A,{className:"text-2xl sm:text-3xl font-display font-bold leading-tight text-foreground shrink-0",children:s.title})]}),e.jsx(k,{asChild:!0,children:e.jsx("div",{className:"text-base text-muted-foreground whitespace-pre-wrap leading-relaxed pb-6",children:s.content})})]})})})}function Se(){const{newsId:s}=y.useSearch(),n=N({from:"/news"}),[l,c]=i.useState(""),[o,f]=i.useState("All"),[p,d]=i.useState(null),{data:a=[],isLoading:g}=w({queryKey:["newsList"],queryFn:()=>v()});i.useEffect(()=>{if(s&&a.length>0){const t=a.find(r=>r.id===s);t&&d(t)}},[s,a]);const j=()=>{d(null),s&&n({search:{}})},b=i.useMemo(()=>{const t=new Set(a.map(r=>r.category));return["All",...Array.from(t)]},[a]),x=i.useMemo(()=>a.filter(t=>{const r=t.title.toLowerCase().includes(l.toLowerCase())||t.content.toLowerCase().includes(l.toLowerCase()),m=o==="All"||t.category===o;return r&&m}).sort((t,r)=>{const m=t.published_at?new Date(t.published_at).getTime():0;return(r.published_at?new Date(r.published_at).getTime():0)-m}),[a,l,o]);return e.jsxs("div",{className:"flex min-h-screen flex-col bg-background",children:[e.jsx(C,{}),e.jsxs("main",{className:"flex-1 pb-20 pt-24 sm:pt-32",children:[e.jsx(D,{title:"News & Announcements"}),e.jsxs("div",{className:"container-academic",children:[e.jsx("p",{className:"mx-auto mt-6 max-w-2xl text-center text-lg leading-relaxed text-muted-foreground mb-12",children:"Stay up to date with the latest stories, research updates, campus events, and announcements from VPPCOE-VA."}),e.jsxs("div",{className:"mb-10 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"relative max-w-md flex-1",children:[e.jsx(B,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(F,{type:"text",placeholder:"Search news...",value:l,onCh
1ange:t=>c(t.target.value),className:"pl-9 h-11 w-full bg-card border-border shadow-sm focus-visible:ring-primary"})]}),e.jsx("div",{className:"w-full sm:w-[12.5rem]",children:e.jsxs(E,{value:o,onValueChange:f,children:[e.jsx(I,{className:"h-11 bg-card border-border shadow-sm",children:e.jsx(M,{placeholder:"Select category"})}),e.jsx(R,{children:b.map(t=>e.jsx(V,{value:t,children:t},t))})]})})]}),g?e.jsx("div",{className:"py-20 text-center text-muted-foreground animate-pulse",children:"Loading news..."}):x.length===0?e.jsxs("div",{className:"py-20 text-center text-muted-foreground bg-card border border-border rounded-xl shadow-sm",children:[e.jsx("p",{className:"text-lg font-medium",children:"No news found."}),e.jsx("p",{className:"text-sm",children:"Try adjusting your search or category filter."})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:x.map(t=>{const r=t.published_at?new Date(t.published_at).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):"Draft";return e.jsxs(O,{className:"flex flex-col overflow-hidden cursor-pointer transition-all hover:-translate-y-1 hover:shadow-md hover:border-primary/40 group",onClick:()=>d(t),children:[t.image_url?e.jsx("div",{className:"aspect-[4/3] w-full overflow-hidden bg-muted relative",children:e.jsx("img",{src:t.image_url,alt:t.title,className:"h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"})}):e.jsx("div",{className:"h-2 bg-primary"}),e.jsxs(P,{className:"flex-1 pb-4",children:[e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-semibold text-primary",children:[e.jsx(u,{className:"h-3 w-3"}),t.category]})}),e.jsx(Q,{className:"text-lg font-display leading-tight group-hover:text-primary transition-colors line-clamp-3",children:t.title})]}),e.jsxs(q,{className:"pt-0 text-xs text-muted-foreground flex justify-between items-center border-t border-border/50 bg-muted/10 px-6 py-3",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(h,{className:"h-3.5 w-3.5"}),r]}),e.jsx("span",{className:"text-primary font-medium opacity-0 group-hover:opacity-100 transition-opacity translate-x-2 group-hover:translate-x-0 transform duration-300",children:"Read more →"})]})]},t.id)})})]})]}),e.jsx(S,{}),e.jsx(H,{news:p,isOpen:!!p,onClose:j})]})}export{Se 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.