<?php

namespace App\Filament\Widgets;

use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

// 1. IMPORT MODEL DULU DI SINI
use App\Models\User;
use App\Models\Promo;
use App\Models\Service;

class StatsOverview extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            // Stat 1: Hitung User
            Stat::make('Total Users', User::count())
                ->description('Semua pengguna terdaftar')
                ->descriptionIcon('heroicon-m-users')
                ->color('primary'), // Biru

            // Stat 2: Hitung Promo
            Stat::make('Total Promo', Promo::count())
                ->description('Promo yang tersedia')
                ->descriptionIcon('heroicon-m-ticket')
                ->color('success'), // Hijau

            // Stat 3: Hitung Service
            Stat::make('Total Services', Service::count())
                ->description('Layanan aktif')
                ->descriptionIcon('heroicon-m-briefcase')
                ->color('warning'), // Kuning
        ];
    }
}