<?php

namespace App\Filament\Admin\Resources\MenuTemplates\Pages;

use App\Filament\Admin\Resources\MenuTemplates\MenuTemplateResource;
use Filament\Actions\DeleteAction;
use Filament\Actions\ForceDeleteAction;
use Filament\Actions\RestoreAction;
use Filament\Actions\ViewAction;
use Filament\Resources\Pages\EditRecord;
use Filament\Support\Enums\Width;

class EditMenuTemplate extends EditRecord
{
    protected static string $resource = MenuTemplateResource::class;

    public function getMaxContentWidth(): Width | string | null
    {
        return Width::Full;
    }

    protected function getHeaderActions(): array
    {
        return [
            ViewAction::make(),
            DeleteAction::make(),
            ForceDeleteAction::make(),
            RestoreAction::make(),
        ];
    }

    protected function afterSave(): void
    {
        // Kaydetme sonrası preview'ı güncelle
        // Livewire event dispatch et
        $this->dispatch('template-saved');
    }
}
