<?php

namespace App\Filament\Resources\Publication\News\Pages;

use App\Filament\Actions\BackAction;
use App\Filament\Resources\Publication\News\NewsResource;
use App\Filament\Support\CheerfulNotification;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;

class EditNews extends EditRecord
{
    protected static string $resource = NewsResource::class;

    protected function getHeaderActions(): array
    {
        return [
            BackAction::make()
                ->url(ListNews::getUrl()),
        ];
    }

    protected function getSavedNotification(): ?Notification
    {
        return CheerfulNotification::update();
    }

    protected function getRedirectUrl(): string
    {
        return $this->getResource()::getUrl('index');
    }
}
