<?php

namespace App\Filament\Resources\RaffleResource\Pages;

use App\Filament\Resources\RaffleResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;

class EditRaffle extends EditRecord
{
    protected static string $resource = RaffleResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\Action::make('preview')
                ->label('Previsualizar')
                ->icon('heroicon-o-device-phone-mobile')
                ->color('warning')
                ->modalContent(fn () => view('filament.resources.raffles.preview', ['record' => $this->getRecord()]))
                ->modalSubmitAction(false)
                ->modalCancelActionLabel('Cerrar')
                ->slideOver(),
            Actions\DeleteAction::make(),
        ];
    }

    protected function getHeaderWidgets(): array
    {
        return [
            RaffleResource\Widgets\RaffleStats::class,
        ];
    }
}
