@extends('layouts.app') @section('content') @if(session('success')) @endif
{{-- Add to watchlist --}}
Add Country
@csrf
{{-- Stats --}}
Summary
@php $total = $watchlist->count(); $critical = $watchlist->filter(fn($w) => $w->risk && $w->risk->risk_label === 'Critical')->count(); $high = $watchlist->filter(fn($w) => $w->risk && $w->risk->risk_label === 'High')->count(); $medium = $watchlist->filter(fn($w) => $w->risk && $w->risk->risk_label === 'Medium')->count(); $low = $watchlist->filter(fn($w) => $w->risk && in_array($w->risk->risk_label, ['Low', null]))->count(); @endphp
Total monitored {{ $total }}
Critical risk {{ $critical }}
High risk {{ $high }}
Medium risk {{ $medium }}
Low / Unscored {{ $total - $critical - $high - $medium }}
{{-- Watchlist cards --}}
@if($watchlist->isEmpty())

Your watchlist is empty.

Add countries using the form on the left to track their supply chain risk.

@else
@foreach($watchlist as $item)
{{ $item->country_name }}
{{ $item->region }} · Added {{ $item->created_at->diffForHumans() }}
@csrf @method('DELETE')
@if($item->risk)
Risk Score {{ round($item->risk->total_score, 1) }}
☁ {{ round($item->risk->weather_risk) }} 📈 {{ round($item->risk->inflation_risk) }} 📰 {{ round($item->risk->news_risk) }} {{ $item->risk->risk_label }}
@else
No risk score yet.
@endif @if($item->notes)
"{{ $item->notes }}"
@endif
@endforeach
@endif
@endsection @push('scripts') @endpush