@extends('layouts.dashboard') @section('title', 'News Intelligence — Supply Chain') @section('content') {{-- SENTIMENT SUMMARY --}}
✅
{{ $sentimentCounts['Positive'] ?? 0 }}
Positive Articles
{{ $totalNews > 0 ? round(($sentimentCounts['Positive'] ?? 0) / $totalNews * 100) : 0 }}% of total
➡️
{{ $sentimentCounts['Neutral'] ?? 0 }}
Neutral Articles
{{ $totalNews > 0 ? round(($sentimentCounts['Neutral'] ?? 0) / $totalNews * 100) : 0 }}% of total
❌
{{ $sentimentCounts['Negative'] ?? 0 }}
Negative Articles
{{ $totalNews > 0 ? round(($sentimentCounts['Negative'] ?? 0) / $totalNews * 100) : 0 }}% of total
{{-- CATEGORY TABS --}}
@foreach(['all'=>'All News','shipping'=>'Shipping','trade'=>'Trade','economy'=>'Economy','logistics'=>'Logistics','political'=>'Political'] as $key => $label) {{ $label }} @endforeach
{{-- NEWS GRID --}} @if($news->isEmpty())
📰
No news available
Click "Refresh News" to fetch the latest articles.
@else
@foreach($news as $item) @if($item['image']) @else
📰
@endif
@if($item['sentiment']) {{ $item['sentiment'] === 'Positive' ? '✅' : ($item['sentiment'] === 'Negative' ? '❌' : '→') }} {{ $item['sentiment'] }} @endif @if($item['source']) {{ $item['source'] }} @endif {{ \Carbon\Carbon::parse($item['published_at'])->diffForHumans() }}
{{ Str::limit($item['title'], 90) }}
@if($item['description'])
{{ Str::limit($item['description'], 100) }}
@endif
@endforeach
{{-- PAGINATION --}}
{{ $news->links() }}
@endif @endsection @push('scripts') @endpush