<?php

namespace App\Filament\Resources\QuestionAssetResource\Widgets;

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

class QuestionAssetStats extends BaseWidget
{
    protected function getStats(): array
    {
        return [
            Stat::make('素材总数', QuestionAsset::query()->count()),
            Stat::make('SVG', QuestionAsset::query()->where('asset_type', 'svg')->count()),
            Stat::make('图片', QuestionAsset::query()->where('asset_type', 'image')->count()),
        ];
    }
}
