<?php

namespace App\Filament\Widgets;

use App\Models\Company;
use App\Models\Product;
use App\Models\Message;
use App\Models\Page;
use App\Models\Quote;
use App\Models\Order;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;

class StatsOverview extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            Stat::make('Total Pages', Page::count())
                ->description(Page::where('is_published', true)->count() . ' published')
                ->descriptionIcon('heroicon-o-document-text')
                ->color('success')
                ->chart([7, 3, 4, 5, 6, 3, 5, 3]),
            
            Stat::make('Orders', Order::count())
                ->description(Order::where('status', 'pending')->count() . ' pending')
                ->descriptionIcon('heroicon-o-shopping-cart')
                ->color('info')
                ->chart([3, 5, 4, 6, 7, 5, 6, 8]),
            
            Stat::make('Quote Requests', Quote::count())
                ->description(Quote::where('status', 'pending')->count() . ' pending')
                ->descriptionIcon('heroicon-o-document-text')
                ->color('primary')
                ->chart([4, 5, 6, 7, 5, 6, 7, 8]),
        ];
    }
}
