<?php

namespace App\Filament\Resources\Monitoring\MediaMonitorings\Pages;

use App\Filament\Exports\MediaMonitoringExcelExport;
use App\Filament\Resources\Monitoring\MediaMonitorings\Actions\CrawlNewsAction;
use App\Filament\Resources\Monitoring\MediaMonitorings\MediaMonitoringResource;
use Filament\Actions\CreateAction;
use Filament\Resources\Pages\ListRecords;
use pxlrbt\FilamentExcel\Actions\ExportAction;

class ListMediaMonitorings extends ListRecords
{
    protected static string $resource = MediaMonitoringResource::class;

    protected static ?string $title = 'Monitoring Media';

    protected function getHeaderActions(): array
    {
        return [
            CreateAction::make()
                ->label('Tambah'),

            CrawlNewsAction::make('crawlNews'),

            ExportAction::make()
                ->exports([
                    MediaMonitoringExcelExport::make()
                        ->fromTable(),
                ])
                ->color('success')
                ->icon(null),
        ];
    }
}
