<?php

namespace App\Filament\Resources\ClasaResource\Pages;

use App\Filament\Resources\ClasaResource;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;

class ListClasas extends ListRecords
{
    protected static string $resource = ClasaResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\Action::make('importElevi')
                ->label('Import elevi CSV')
                ->icon('heroicon-o-arrow-up-tray')
                ->color('success')
                ->url(ClasaResource::getUrl('import-elevi'))
                ->visible(fn() => auth()->user()?->hasAnyRole(['admin', 'director', 'secretariat'])),
            Actions\CreateAction::make(),
        ];
    }
}
