PageSourceSearch

https://tradeintelx.com/assets/TrendingTopics-Dh5jNgrh.js

js tradeintelx.com collected 2026-09-24 14:56:03 UTC 6,271 bytes, 1 lines download raw bytes

1import{o as w}from"./rolldown-runtime-ChpBd9eV.js";import{Cn as v,Dn as b,Gt as N,La as j,Ta as k,Tn as S,da as m,h as y,jt as A,wn as T}from"./chat-page-evUfHQgD.js";import{g as R}from"./dashboard-page-CleTLBe1.js";var i=w(j(),1),e=k(),P=()=>{const[d,c]=(0,i.useState)([]),[p,h]=(0,i.useState)(!0);(0,i.useEffect)(()=>{u()},[]);const u=async()=>{try{h(!0),console.log("🔥 TrendingTopics: Fetching from RSS → Massive → StockNews → FMP → NewsAPI...");const t=["AAPL","MSFT","TSLA","NVDA","GOOGL","SPY","QQQ"],a=[];try{const r=await y.getNews({limit:30,timeframe:"24h"});r?.articles?.length>0&&(a.push(...r.articles.map(s=>({title:s.title,url:s.url,source:s.sourceName||s.source||"RSS",publishedAt:s.publishedAt,sentiment:s.sentiment||"neutral"}))),console.log(`✅ RSS returned ${r.articles.length} articles`))}catch(r){console.warn("⚠️ RSS fetch failed:",r)}try{const r=t.map(n=>({symbol:n})),s=await R.getPersonalizedNews([],r,{limit:30,minRelevanceScore:0});s.articles?.length>0&&(a.push(...s.articles.map(n=>({title:n.title,url:n.url,source:n.source,publishedAt:n.publishedAt,sentiment:n.sentiment||"neutral"}))),console.log(`✅ Personalized APIs returned ${s.articles.length} articles`),console.log("📊 Sources:",s.sources))}catch(r){console.warn("⚠️ Personalized APIs fetch failed:",r)}const l=new Set,o=a.filter(r=>!r.title||r.title==="[Removed]"||l.has(r.url)?!1:(l.add(r.url),!0)).sort((r,s)=>new Date(s.publishedAt)-new Date(r.publishedAt)).slice(0,8);c(o),console.log(`🔥 TrendingTopics loaded ${o.length} articles`)}catch(t){console.error("Error fetching trending news:",t),c([])}finally{h(!1)}},x=t=>{if(!t)return"";const a=new Date,l=new Date(t),o=Math.floor((a-l)/(1e3*60));return o<60?`${o}m ago`:o<1440?`${Math.floor(o/60)}h ago`:`${Math.floor(o/1440)}d ago`},g=t=>{switch(t){case"positive":return"text-green-400";case"negative":return"text-red-400";default:return"text-slate-400"}},f=t=>t==="positive"?(0,e.jsx)(v,{className:"w-3 h-3"}):t==="negative"?(0,e.jsx)(T,{className:"w-3 h-3"}):null;return(0,e.jsxs)("div",{className:"bg-white dark:bg-white/10 backdrop-blur-xl border border-slate-200 dark:border-white/20 rounded-xl p-6 shadow-lg dark:shadow-2xl relative overflow-hidden",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-orange-500/10 via-red-500/5 to-pink-500/10 pointer-events-none"}),(0,e.jsxs)("div",{className:"relative z-10",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,e.jsx)(N,{className:"w-5 h-5 text-orange-400"}),(0,e.jsx)("h3",{className:"text-lg font-semibold bg-gradient-to-r from-orange-400 to-red-400 bg-clip-text text-transparent",children:"Trending Now"})]}),p?(0,e.jsx)("div",{className:"space-y-3",children:[...Array(6)].map((t,a)=>(0,e.jsx)("div",{className:"flex items-center justify-between p-3 animate-pulse",children:(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("div",{className:"w-4 h-4 bg-slate-600 rounded"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"w-48 h-4 bg-slate-600 rounded mb-1"}),(0,e.jsx)("div",{className:"w-24 h-3 bg-slate-700 rounded"})]})]})},a))}):(0,e.jsxs)("div",{className:"space-y-3",children:[d.slice(0,6).map((t,a)=>(0,e.jsxs)(m.a,{href:t.url,target:"_blank",rel:"noopener noreferrer",whileHover:{x:4,scale:1.02},className:"flex items-start gap-3 p-3 hover:bg-slate-100 dark:hover:bg-white/20 rounded-xl cursor-pointer transition-all duration-300 border border-slate-200 dark:border-white/10 hover:border-slate-300 dark:hover:border-white/20 group relative overflow-hidden",children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-orange-500/20 to-red-500/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),(0,e.jsx)("div",{className:"flex-1 relative z-10",children:(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)(A,{className:"w-4 h-4 text-purple-400 group-hover:text-purple-300 transition-colors mt-0.5 flex-shrink-0"}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-slate-900 dark:text-white text-sm font-medium line-clamp-2 group-hover:text-orange-600 dar
1k:group-hover:text-orange-200 transition-colors",children:t.title}),(0,e.jsxs)("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[(0,e.jsx)("span",{className:"text-slate-500 dark:text-white/70 text-xs",children:t.source}),(0,e.jsx)("span",{className:"text-slate-300 dark:text-white/30",children:"•"}),(0,e.jsx)("span",{className:"text-slate-500 dark:text-white/70 text-xs",children:x(t.publishedAt)}),t.sentiment&&t.sentiment!=="neutral"&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-slate-300 dark:text-white/30",children:"•"}),(0,e.jsxs)("span",{className:`text-xs flex items-center gap-1 ${g(t.sentiment)}`,children:[f(t.sentiment),t.sentiment]})]})]})]}),(0,e.jsx)(S,{className:"w-4 h-4 text-slate-400 dark:text-white/40 group-hover:text-slate-600 dark:group-hover:text-white/80 transition-colors flex-shrink-0"})]})})]},t.url||a)),d.length===0&&(0,e.jsxs)("div",{className:"text-center py-8 text-slate-500 dark:text-slate-300",children:[(0,e.jsx)("p",{children:"No trending topics yet."}),(0,e.jsx)("p",{className:"text-sm mt-1",children:"Topics will appear as users post content."})]})]})]}),(0,e.jsxs)(m.button,{whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},className:"w-full mt-4 py-3 bg-gradient-to-r from-purple-100 to-blue-100 dark:from-purple-500/20 dark:to-blue-500/20 text-purple-700 dark:text-white rounded-xl border border-purple-200 dark:border-white/20 hover:border-purple-300 dark:hover:border-white/30 hover:from-purple-200 hover:to-blue-200 dark:hover:from-purple-500/30 dark:hover:to-blue-500/30 transition-all duration-300 backdrop-blur-sm font-medium text-sm group relative overflow-hidden",onClick:u,children:[(0,e.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-purple-400/30 to-blue-400/30 opacity-0 group-hover:opacity-100 transition-opacity duration-300 blur-xl"}),(0,e.jsxs)("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[(0,e.jsx)(b,{className:"w-4 h-4 group-hover:rotate-180 transition-transform duration-500"}),"Refresh Trending Topics"]})]})]})};export{P 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.