@extends('layouts.user') @section('title', 'Global News Intelligence') @push('styles') @endpush @section('content') {{-- Flower Decorations --}}
Decorative Flower
Decorative Flower
{{-- ── Header ─────────────────────────────────────────────────── --}}

Global News Intelligence

Comprehensive supply chain news analysis with AI-powered sentiment insights and risk assessment.

{{-- ── Summary Cards ──────────────────────────────────────────────── --}}
📰

{{ number_format($stats['total_articles']) }}

Total Articles

📈

{{ number_format($stats['positive_articles']) }}

Positive Articles

➖

{{ number_format($stats['neutral_articles']) }}

Neutral Articles

📉

{{ number_format($stats['negative_articles']) }}

Negative Articles

{{-- ── Today's Analysis Summary ────────────────────────────────── --}}

🔍 Today's Analysis Summary

{{ number_format($stats['today_analyzed']) }}

Articles Analyzed

{{ number_format($stats['countries_affected']) }}

Countries Affected

{{ number_format($stats['high_risk_articles']) }}

High Risk Articles

{{ number_format($stats['medium_risk_articles']) }}

Medium Risk Articles

{{ number_format($stats['low_risk_articles']) }}

Low Risk Articles

{{-- ── News Articles with Sentiment Analysis ────────────────────── --}}
@foreach($news ?? [] as $article)
@if($article->image_url) {{ $article->title }} @else
📰
@endif
{{-- Category, Country, and Sentiment Row --}}
{{ $article->newsCategory?->name ?? $article->category ?? 'General' }} @if($article->country) •
@if($article->country->flag_url) {{ $article->country->name }} @endif {{ $article->country->name }}
@endif
{{-- Sentiment Badge --}} @if($article->newsSentiment) @php $sentiment = $article->newsSentiment->sentiment; $badgeClass = $sentiment === 'positive' ? 'news-sentiment-positive' : ($sentiment === 'negative' ? 'news-sentiment-negative' : 'news-sentiment-neutral'); @endphp {{ ucfirst($sentiment) }} @endif

{{ $article->title ?? 'News Article' }}

{{ $article->description ?? 'No description available.' }}

{{-- Risk Impact and Affected Components --}} @if($article->newsSentiment)
{{-- Risk Impact --}} @php $impact = 0; if ($article->newsSentiment->sentiment === 'positive') { $impact = round($article->newsSentiment->positive_score * 10); } elseif ($article->newsSentiment->sentiment === 'negative') { $impact = -round($article->newsSentiment->negative_score * 10); } $riskLevel = 'low'; if (abs($impact) >= 7) $riskLevel = 'high'; elseif (abs($impact) >= 4) $riskLevel = 'medium'; @endphp
Risk Impact: @if($impact !== 0) {{ $impact > 0 ? '+' : '' }}{{ $impact }} Risk @else No Impact @endif
{{-- Affected Components --}}
Components: @if($article->country) Country @endif @if($article->newsCategory && in_array(strtolower($article->newsCategory->name), ['economy', 'financial', 'trade'])) Economy @endif @if($article->newsCategory && in_array(strtolower($article->newsCategory->name), ['weather', 'climate', 'disaster'])) Weather @endif @if($article->newsCategory && in_array(strtolower($article->newsCategory->name), ['shipping', 'port', 'logistics'])) Port @endif @if($article->newsCategory && in_array(strtolower($article->newsCategory->name), ['currency', 'exchange', 'forex'])) Currency @endif
@endif {{-- Source and Date --}}
{{ $article->source ?? 'Unknown Source' }} {{ $article->published_at ? \Carbon\Carbon::parse($article->published_at)->diffForHumans() : 'Unknown date' }}
@endforeach
{{-- Pagination --}} @if(isset($news) && method_exists($news, 'links'))
{{ $news->links() }}
@endif
@endsection