<?php

declare(strict_types=1);

namespace App\Filament\Resources\BaselineProfileResource\Pages;

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

class ListBaselineProfiles extends ListRecords
{
    protected static string $resource = BaselineProfileResource::class;

    protected function getHeaderActions(): array
    {
        return [
            CreateAction::make()
                ->label('Create baseline profile')
                ->disabled(fn (): bool => ! BaselineProfileResource::canCreate())
                ->visible(fn (): bool => $this->getTableRecords()->count() > 0),
        ];
    }

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