@extends('layouts.app') @section('title', 'My Sponsorships — TAM') @section('content') {{-- Page Header --}}

My Sponsorships

Welcome back, {{ auth()->user()->name }}

Sponsor Another Child
{{-- Flash Messages --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Stats Row --}} @if($sponsorships->isNotEmpty())

Children Sponsored

{{ $sponsorships->count() }}

Active

{{ $sponsorships->where('status', 'active')->count() }}

Monthly Total

${{ number_format($sponsorships->where('status', 'active')->sum('amount'), 2) }}

@endif {{-- Sponsorships --}} @if($sponsorships->isEmpty())

No Sponsorships Yet

You haven't sponsored a child yet. Browse children waiting for a sponsor and start your journey today.

Browse Children
@else

Your Sponsored Children

@foreach($sponsorships as $sponsorship)
{{-- Photo Banner --}}
@if($sponsorship->child->photo_url) {{ $sponsorship->child->first_name }} @else
@endif {{-- Status badge --}} {{ ucfirst($sponsorship->status) }}

{{ $sponsorship->child->first_name }} {{ $sponsorship->child->last_name }}

{{ $sponsorship->child->age }} yrs • {{ $sponsorship->child->country }}

Monthly amount ${{ number_format($sponsorship->amount, 2) }}
Since {{ $sponsorship->starts_at?->format('M d, Y') ?? '—' }}
@if($sponsorship->child->school_level)
School level {{ $sponsorship->child->school_level }}
@endif
@endforeach
@endif
@endsection