@extends('layouts.admin') @section('title', 'Article Detail - ' . Str::limit($article->title, 50)) @push('styles') @endpush @section('content') {{-- Page Header --}}

Article Detail

@if(!$article->newsSentiment)
@csrf
@endif
@csrf @method('PATCH')
Back to Articles
@if($article->image_url) Article image @endif
@if($article->country) {{ $article->country->name }} @endif @if($article->newsCategory) {{ $article->newsCategory->name }} @endif {{ $article->published_at ? 'Published' : 'Draft' }}

{{ $article->title }}

@if($article->author) By {{ $article->author }} @endif @if($article->source) Source: {{ $article->source }} @endif @if($article->published_at) {{ $article->published_at->format('F j, Y \a\t g:i A') }} @endif
@if($article->description)
{{ $article->description }}
@endif @if($article->content)
{{ $article->content }}
@endif @if($article->url) @endif

Sentiment Analysis

@if($article->newsSentiment)
@php $sentiment = $article->newsSentiment->sentiment; $bgClass = $sentiment === 'positive' ? 'bg-green-900 text-green-300' : ($sentiment === 'negative' ? 'bg-red-900 text-red-300' : 'bg-yellow-900 text-yellow-300'); @endphp
@if($sentiment === 'positive') @elseif($sentiment === 'negative') @else @endif {{ ucfirst($sentiment) }}
Positive {{ number_format($article->newsSentiment->positive_percentage, 1) }}%
Negative {{ number_format($article->newsSentiment->negative_percentage, 1) }}%
Neutral {{ number_format($article->newsSentiment->neutral_percentage, 1) }}%
Total Words {{ number_format($article->newsSentiment->total_words) }}
Analyzed Words {{ number_format($article->newsSentiment->analyzed_words) }}
Positive Score {{ number_format($article->newsSentiment->positive_score, 2) }}
Negative Score {{ number_format($article->newsSentiment->negative_score, 2) }}
@else

Belum dianalisis

@csrf
@endif

Risk Impact

@if($article->newsSentiment) @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); } @endphp
@if($impact > 0) +{{ $impact }} @elseif($impact < 0) {{ $impact }} @else 0 @endif

Impact Score

Affected Components

@if($article->country)
Country Risk
{{ $impact !== 0 ? ($impact > 0 ? '+' . abs($impact) : $impact) : '0' }}
@endif @if($article->newsCategory && in_array(strtolower($article->newsCategory->name), ['economy', 'financial', 'trade']))
Economy
{{ $impact !== 0 ? ($impact > 0 ? '+' . abs($impact) : $impact) : '0' }}
@endif @if($article->newsCategory && in_array(strtolower($article->newsCategory->name), ['weather', 'climate', 'disaster']))
Weather
{{ $impact !== 0 ? ($impact > 0 ? '+' . abs($impact) : $impact) : '0' }}
@endif @if($article->newsCategory && in_array(strtolower($article->newsCategory->name), ['shipping', 'port', 'logistics']))
Port Operations
{{ $impact !== 0 ? ($impact > 0 ? '+' . abs($impact) : $impact) : '0' }}
@endif
@else

Analisis sentimen diperlukan untuk menghitung risk impact

@endif

Publish Status

Current Status {{ $article->published_at ? 'Published' : 'Draft' }}
@if($article->published_at)
Published At {{ $article->published_at->format('M d, Y g:i A') }}
@endif

{{ $article->published_at ? 'Artikel ini akan tampil pada halaman News user.' : 'Artikel ini tidak akan tampil pada halaman News user.' }}

@endsection