<?php

namespace App\Filament\Resources\IndividualZoneResource\Pages;

use App\Filament\Resources\IndividualZoneResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use Filament\Notifications\Notification;
use Illuminate\Support\Facades\Gate;
class EditIndividualZone extends EditRecord
{
    protected static string $resource = IndividualZoneResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\DeleteAction::make()
                ->visible(fn () => Gate::allows('delete individualzone')),
        ];
    }

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

    protected function getSavedNotification(): ?Notification
    {
        return Notification::make()
            ->success()
            ->title('Individual Zone updated successfully')
            ->body('The individual zone has been updated successfully.');
    }

    protected function mutateFormDataBeforeSave(array $data): array
    {
        return $data;
    }
}