<?php

namespace App\Filament\Widgets;

use App\Models\Lead;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class LeadStatsWidget extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            Stat::make('Total leaduri', Lead::query()->count()),
            Stat::make('Ultimele 7 zile', Lead::query()->where('created_at', '>=', now()->subDays(7))->count()),
            Stat::make('Astazi', Lead::query()->whereDate('created_at', now()->toDateString())->count()),
        ];
    }
}
