@extends('layouts.admin') @section('title', 'Country Dashboard - ' . $country->name) @section('content')
@if($country->flag) Flag of {{ $country->name }} @else
@endif

{{ $country->name }}

{{ $country->capital ?? 'Unknown Capital' }}, {{ $country->continent ?? 'Unknown Continent' }}

Populasi: {{ $country->population ? number_format($country->population) : 'N/A' }} Mata Uang: {{ $country->currency_code ?? 'N/A' }}
@if(Auth::check())
@csrf
@endif
Peta Lokasi & Infrastruktur
{{ $ports->count() }} Pelabuhan
@if(!$country->latitude || !$country->longitude)

Koordinat negara tidak tersedia.

@endif
@php $riskColor = 'secondary'; $riskBg = '#f8f9fa'; $riskIcon = 'bi-shield-check'; $riskLevel = 'N/A'; if($risk && $risk->total_score) { // Calculate risk level based on total_score if($risk->total_score >= 30) { $riskLevel = 'Tinggi'; $riskColor = 'danger'; $riskBg = '#fef2f2'; $riskIcon = 'bi-shield-x'; } elseif($risk->total_score >= 20) { $riskLevel = 'Sedang'; $riskColor = 'warning'; $riskBg = '#fffbeb'; $riskIcon = 'bi-shield-exclamation'; } else { $riskLevel = 'Rendah'; $riskColor = 'success'; $riskBg = '#ecfdf5'; $riskIcon = 'bi-shield-check'; } } @endphp
Skor Analisis Risiko

{{ $risk ? number_format($risk->total_score, 1) : 'N/A' }} / 100

@if($risk)
Tingkat Risiko: {{ $riskLevel }} {{ optional($risk->calculated_at)->diffForHumans() }}
@else

Analisis risiko belum pernah dijalankan.

@endif
Kondisi Cuaca Saat Ini
@if($weather)
@php $icon = 'bi-cloud'; if(str_contains(strtolower($weather->weather_condition ?? ''), 'clear')) $icon = 'bi-sun text-warning'; if(str_contains(strtolower($weather->weather_condition ?? ''), 'rain')) $icon = 'bi-cloud-rain text-primary'; if(str_contains(strtolower($weather->weather_condition ?? ''), 'thunderstorm')) $icon = 'bi-cloud-lightning-rain text-dark'; @endphp

{{ number_format($weather->temperature, 1) }}°C

{{ $weather->weather_condition ?? 'Unknown' }}

Kecepatan Angin {{ number_format($weather->wind_speed, 1) }} km/h
Curah Hujan {{ number_format($weather->rainfall ?? 0, 1) }} mm
@else
Data cuaca tidak tersedia.
@endif
Indikator Ekonomi ({{ $economy->year ?? '-' }})
@if($economy)
GDP ${{ number_format($economy->gdp / 1000000000, 2) }} Milyar

Inflasi {{ number_format($economy->inflation, 2) }}%
@else
Data ekonomi tidak tersedia.
@endif
Nilai Tukar
@if($exchange && $country->currency_code)
1 USD
{{ number_format($exchange->exchange_rate, 2) }} {{ $country->currency_code }}
Update: {{ optional($exchange->recorded_at)->diffForHumans() }}
@else
Data kurs tidak tersedia.
@endif
@endsection @push('scripts') @endpush