<?php

declare(strict_types=1);

namespace App\Filament\Resources\Newsletters\Tables;

use Filament\Actions\BulkActionGroup;
use Filament\Actions\DeleteBulkAction;
use Filament\Actions\ExportAction;
use Filament\Actions\ViewAction;
use Filament\Actions\Exports\Enums\ExportFormat;
use Filament\Tables\Table;

class NewslettersTable
{
    public static function configure(Table $table): Table
    {
        return $table
            ->columns([
                \App\Filament\Components\Table\EmailTextColumn::create(),
                \App\Filament\Components\Table\CellphoneTextColumn::create(),
                \App\Filament\Components\Table\CreatedAtTextColumn::create(),
            ])
            ->filters([
                //
            ])
            ->recordActions([
                ViewAction::make(),
            ])
            ->headerActions([
                ExportAction::make()
                    ->exporter(\App\Filament\Exports\NewsletterExporter::class)
                    ->formats([ExportFormat::Xlsx])
                    ->label('خروجی اکسل'),
            ])
            ->toolbarActions([
                BulkActionGroup::make([
                    DeleteBulkAction::make(),
                ]),
            ]);
    }
}
