/* * ============================================================================= * VibeQuant (vquant) — AI-Powered Financial Intelligence Platform * ----------------------------------------------------------------------------- * File: client/src/components/explore/news-view.tsx * * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * Website: https://www.spboucher.ai * Demo: https://www.vquant.ai * License: MIT (see LICENSE) * * Copyright © 2026 Simon-Pierre Boucher. All rights reserved. * ============================================================================= */ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Newspaper, ExternalLink, Calendar, TrendingUp } from "lucide-react"; interface NewsArticle { title: string; text: string; url: string; site: string; publishedDate: string; symbol: string; image?: string; [key: string]: any; } interface NewsViewProps { news?: NewsArticle[]; } export function NewsView({ news }: NewsViewProps) { const formatDate = (dateString: string) => { const date = new Date(dateString); const now = new Date(); const diffInHours = Math.floor((now.getTime() - date.getTime()) / (1000 * 60 * 60)); if (diffInHours < 1) return "Il y a moins d'une heure"; if (diffInHours < 24) return `Il y a ${diffInHours} heure${diffInHours > 1 ? 's' : ''}`; if (diffInHours < 48) return "Hier"; return date.toLocaleDateString('fr-FR', { year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit' }); }; if (!news || news.length === 0) { return ( Actualités Financières

Aucune actualité disponible

); } return (

Actualités & Analyses

{news.length} article{news.length > 1 ? 's' : ''} récent{news.length > 1 ? 's' : ''}

{news.map((article, idx) => ( window.open(article.url, '_blank')} >
{/* Image */} {article.image && (
{article.title} { (e.target as HTMLImageElement).style.display = 'none'; }} />
)} {/* Content */}

{article.title}

{article.text}

{formatDate(article.publishedDate)} {article.site} {article.symbol && ( {article.symbol} )}
))}
{/* Load More Button */} {news.length >= 10 && ( )}
); }