<?php

namespace App\Filament\Resources\MarkdownImportResource\Widgets;

use App\Models\MarkdownImport;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;

class MarkdownImportStatsWidget extends BaseWidget
{
    protected static ?int $sort = 1;

    protected function getCards(): array
    {
        return [
            \Filament\Widgets\StatsOverviewWidget\Stat::make('总导入数', MarkdownImport::count()),
            \Filament\Widgets\StatsOverviewWidget\Stat::make('待处理', MarkdownImport::where('status', 'pending')->count()),
            \Filament\Widgets\StatsOverviewWidget\Stat::make('已解析', MarkdownImport::where('status', 'parsed')->count()),
            \Filament\Widgets\StatsOverviewWidget\Stat::make('已完成', MarkdownImport::where('status', 'completed')->count()),
        ];
    }
}
