PageSourceSearch

https://www.emirates247.com/assets/TrendingWidget-g3yUqtS7.js

js emirates247.com collected 2026-10-01 10:46:19 UTC 2,974 bytes, 1 lines download raw bytes

1import{a,j as e}from"./vendor-react-CDFIE44H.js";import{u as x}from"./vendor-query-BKeeEAAr.js";import{O as p,p as g}from"./index-B7SSE3m4.js";import{w as j,f as v,e as y}from"./vendor-icons-BsQZz6Pl.js";import"./vendor-router-nJKcHAGV.js";import"./vendor-radix-Cxb7F2zo.js";import"./vendor-utils-DSOPSYhy.js";const w="/res/img/eb247/logo-1024x576.png";function N(s){return g(s.url)}function U({posts:s}={}){const{data:d}=x({...p(),enabled:s===void 0}),l=a.useRef(null),[m,h]=a.useState(!1),[u,f]=a.useState(!0),o=s??d?.posts??[];if(o.length===0)return null;const i=()=>{const t=l.current;t&&(h(t.scrollLeft>10),f(t.scrollLeft<t.scrollWidth-t.clientWidth-10))},n=t=>{const r=l.current;if(!r)return;const c=280,b=t==="left"?-c*2:c*2;r.scrollBy({left:b,behavior:"smooth"}),setTimeout(i,350)};return e.jsxs("section",{className:"mb-12","data-testid":"trending-widget",children:[e.jsxs("div",{className:"flex items-center justify-between border-b-2 border-primary pb-2 mb-5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"w-5 h-5 text-primary"}),e.jsx("h2",{className:"text-xl font-bold uppercase tracking-wide text-primary","data-testid":"text-trending-title",children:"Trending News"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>n("left"),disabled:!m,className:"w-8 h-8 rounded-full border border-slate-300 dark:border-slate-600 flex items-center justify-center hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Scroll left","data-testid":"button-trending-prev",children:e.jsx(v,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>n("right"),disabled:!u,className:"w-8 h-8 rounded-full border border-slate-300 dark:border-slate-600 flex items-center justify-center hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Scroll right","data-testid":"button-trending-next",children:e.jsx(y,{className:"w-4 h-4"})})]})]}),e.jsx("div",{className:"relative",children:e.jsx("div",{ref:l,onScroll:i,className:"flex gap-4 overflow-x-auto scroll-smooth scrollbar-hide pb-2",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:o.map((t,r)=>e.jsxs("a",{href:N(t),className:"group flex-shrink-0 w-[260px] cursor-pointer","data-testid":`link-trending-post-${r}`,children:[e.jsxs("div",{className:"relative overflow-hidden rounded-sm aspect-[16/9] mb-2",children:[e.jsx("img",{src:t.image||w,alt:t.title,style:{objectFit:"contain",width:"100%",height:"100%"},loading:"lazy"}),t.section&&e.jsx("span",{className:"absolute top-2 left-2 bg-primary text-white text-[10px] font-bold uppercase px-2 py-0.5",children:t.section})]}),e.jsx("h3",{className:"font-serif font-bold text-sm leading-snug group-hover:text-primary transition-colors line-clamp-3 min-h-[3.75rem]","data-testid":`text-trending-title-${r}`,children:t.title})]},r))})})]})}export{U 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.