@extends('layouts.app') @section('title','My Recycling Insights') @push('styles') @endpush @section('content') {{-- Date range filter --}}
Period: @foreach(['all'=>'All Time','6months'=>'6 Months','3months'=>'3 Months','month'=>'This Month','week'=>'This Week'] as $val=>$lbl) {{ $lbl }} @endforeach Share Insights
{{-- Benchmark banner --}} @if($percentile !== null && $percentile > 0)
🏆
You're in the top {{ 100 - $percentile }}% of Nabola recyclers!
You recycle more than {{ $percentile }}% of {{ number_format($totalUsers) }} active users
View Leaderboard →
@endif {{-- Month comparison --}} @if($kgChange !== null)
{{ $kgChange >= 0 ? '+' : '' }}{{ $kgChange }}% vs last month — {{ number_format($thisMonthKg,1) }}kg this month vs {{ number_format($lastMonthKg,1) }}kg last month
@endif
{{ number_format($co2Saved, 1) }} kg
CO emissions saved through your recycling
Equivalent to planting
{{ number_format($co2Saved / 21, 1) }} trees
{{-- ── AI RECYCLING COACH ── --}} @if(count($aiCoachTips) > 0)
🤖
AI Recycling Coach
Personalised tips based on your recycling patterns
@foreach($aiCoachTips as $tip)
{{ $tip['icon'] }}
{{ $tip['title'] }}
{{ $tip['body'] }}
{{ $tip['cta'] }} →
@endforeach
@endif {{-- ── AI EARNINGS FORECAST ── --}} @if($aiForecast['avg_per_day'] > 0)
📊
AI Earnings Forecast
Based on your last 30 days
{{ number_format($aiForecast['forecast_7_days']) }}
NC next 7 days
≈ ₦{{ number_format($aiForecast['naira_forecast']) }}
{{ $aiForecast['avg_per_day'] }}
NC avg per day
@if($aiForecast['avg_kg_per_week'] > 0)
{{ $aiForecast['avg_kg_per_week'] }}
kg avg per week
@endif @if($aiForecast['days_to_milestone'])
{{ $aiForecast['days_to_milestone'] }}
days to {{ $aiForecast['next_milestone'] }}kg milestone
@endif
@if($aiForecast['top_category'])
Your most recycled category is {{ ucfirst($aiForecast['top_category']) }}. @if($aiForecast['kg_to_milestone']) Recycle {{ $aiForecast['kg_to_milestone'] }}kg more to reach your next milestone. @endif
@endif
@endif {{-- ── AI PERSONAL CHALLENGE ── --}} @if($aiChallenge)
{{ $aiChallenge['emoji'] }}
🤖 AI Suggested
{{ $aiChallenge['title'] }}
{{ $aiChallenge['reason'] }}
+{{ $aiChallenge['reward'] }} NC
reward
Start Now
@endif
{{ number_format($totalKg, 1) }}
Total kg Recycled
{{ number_format($totalLogs) }}
Confirmed Recyclings
{{ number_format($totalEarned) }}
Total Coins Earned
{{ number_format($co2Saved, 1) }}
kg CO Saved
Waste by Category
@if($byCategory->count() > 0) @else
No recycling data yet.
@endif
Coins Earned (30 days)
Category Breakdown
@php $colors = ['plastic'=>'#60a5fa','paper'=>'#fbbf24','metal'=>'#a78bfa','e-waste'=>'#f87171','organic'=>'#34d399','glass'=>'#fb923c','other'=>'#9ca3af']; $maxKg = $byCategory->max('total_kg') ?: 1; @endphp @forelse($byCategory->sortByDesc('total_kg') as $cat) @php $color = $colors[$cat->waste_category] ?? '#9ca3af'; @endphp
{{ $cat->waste_category }}
{{ number_format($cat->total_kg, 1) }} kg
@empty
No data yet.
@endforelse
Monthly Recycling (6 months)
Recycling Method Breakdown
@foreach($byType as $t) @php $typeColors = ['pickup'=>'#60a5fa','machine'=>'#a78bfa','dropoff'=>'#34d399']; $typeIcons = ['pickup'=>'fa-truck','machine'=>'fa-robot','dropoff'=>'fa-map-marker-alt']; $tc = $typeColors[$t->type] ?? '#9ca3af'; $ti = $typeIcons[$t->type] ?? 'fa-recycle'; @endphp
{{ $t->count }}
{{ ucfirst($t->type) }}
{{ number_format($t->total_coins) }} NC earned
@endforeach @if($byType->isEmpty())
No recycling activity yet.
@endif
@push('scripts') @endpush @endsection