<?php

declare(strict_types=1);

namespace App\Filament\Resources\AlertRuleResource\Pages;

use App\Filament\Resources\AlertRuleResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;

class ListAlertRules extends ListRecords
{
    protected static string $resource = AlertRuleResource::class;

    protected function getHeaderActions(): array
    {
        return [
            CreateAction::make()
                ->label('Create rule')
                ->disabled(fn (): bool => ! AlertRuleResource::canCreate()),
        ];
    }

    protected function getTableEmptyStateActions(): array
    {
        return [
            CreateAction::make()
                ->label('Create rule')
                ->disabled(fn (): bool => ! AlertRuleResource::canCreate()),
        ];
    }
}
