@extends('admin.template')

@section('content')
    <div class="content-wrapper">
        <div class="row">
            <div class="col-md-12 grid-margin">
                <div class="row">
                    <div class="mb-4 col-12 col-xl-8 mb-xl-0">
                        <h3 class="font-weight-bold">Selamat Datang Admin!</h3>
                        <h6 class="mb-0 font-weight-normal">Sistem ini membantu admin dalam pengelolaan TPS di <span
                                class="text-primary">Kabupaten Nganjuk</span></h6>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">

            {{-- TOTAL TPS --}}
            <div class="mb-4 col-12 col-sm-6 col-md-4 stretch-card transparent">
                <div class="card card-light-green h-100">
                    <div class="card-body">
                        <p class="mb-2">Total TPS</p>
                        <p class="mb-1 fs-30 fw-bold">
                            {{ $totalTps }}
                        </p>
                        <br>
                        <small class="text-muted">
                            TPS terdaftar di sistem
                        </small>
                    </div>
                </div>
            </div>

            {{-- TOTAL ADUAN TPS --}}
            <div class="mb-4 col-12 col-sm-6 col-md-4 stretch-card transparent">
                <div class="card card-dark-green h-100">
                    <div class="card-body">
                        <p class="mb-2">Total Aduan TPS</p>
                        <p class="mb-1 fs-30 fw-bold">
                            {{ $totalAduan }}
                        </p>
                        <br>
                        <small class="text-muted">
                            Aduan dari masyarakat
                        </small>
                    </div>
                </div>
            </div>

            {{-- DATA SAMPAH TERBARU --}}
            <div class="mb-4 col-12 col-sm-6 col-md-4 stretch-card transparent">
                <div class="card card-light-danger h-100">
                    <div class="card-body">
                        <p class="mb-2">Data Sampah Terbaru</p>
                        <p class="mb-1 fs-30 fw-bold">
                            {{ number_format($sampahTerbaru->total_sampah ?? 0, 0, ',', '.') }}
                        </p>
                        <small class="text-muted">
                            Total sampah (Ton) <br>
                            Update terakhir:
                            {{ $sampahTerbaru ? \Carbon\Carbon::parse($sampahTerbaru->created_at)->translatedFormat('d M Y') : '-' }}
                        </small>

                    </div>
                </div>
            </div>

        </div>

    </div>
@endsection
