<?php

namespace App\Filament\Resources\ActivityResource\Pages;

use App\Filament\Exports\ActivityExporter;
use App\Filament\Imports\ActivityImporter;
use App\Filament\Resources\ActivityResource;
use Filament\Actions;
use Filament\Actions\Exports\Enums\ExportFormat;
use Filament\Resources\Pages\ListRecords;

class ListActivities extends ListRecords
{
    protected static string $resource = ActivityResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\ExportAction::make()
                ->exporter(ActivityExporter::class)
                ->label('Export')
                ->icon('heroicon-o-arrow-down-tray')
                ->color('success')
                ->formats([
                    ExportFormat::Xlsx,
                    ExportFormat::Csv,
                ]),
            Actions\ImportAction::make()
                ->importer(ActivityImporter::class)
                ->label('Import')
                ->icon('heroicon-o-arrow-up-tray')
                ->color('warning')
                ->maxRows(5000),
            Actions\CreateAction::make(),
        ];
    }
}
