<?php

namespace App\Filament\Widgets;

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

class StatsOverview extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            Stat::make('Total Revenue', '৳' . \App\Models\Invoice::where('status', 'Paid')->sum('total'))
            ->description('Collected revenue')
            ->descriptionIcon('heroicon-m-banknotes')
            ->color('success'),
            Stat::make('Pending Revenue', '৳' . \App\Models\Invoice::where('status', 'Pending')->sum('total'))
            ->description('Awaiting payment')
            ->descriptionIcon('heroicon-m-clock')
            ->color('danger'),
            Stat::make('Total Patients', \App\Models\Patient::count())
            ->description('Registered patients')
            ->descriptionIcon('heroicon-m-users')
            ->color('primary'),
            Stat::make('Prescriptions', \App\Models\Prescription::count())
            ->description('Issued prescriptions')
            ->descriptionIcon('heroicon-m-document-text')
            ->color('warning'),
        ];
    }
}
