<?php

namespace App\Filament\Resources\ReviewPackResource\Pages;

use App\Filament\Resources\ReviewPackResource;
use Filament\Resources\Pages\ListRecords;

class ListReviewPacks extends ListRecords
{
    protected static string $resource = ReviewPackResource::class;

    protected function getHeaderActions(): array
    {
        return [
            ReviewPackResource::generatePackAction()
                ->visible(fn (): bool => $this->tableHasRecords()),
        ];
    }

    private function tableHasRecords(): bool
    {
        return $this->getTableRecords()->count() > 0;
    }
}
