<?php

namespace App\Filament\Resources\EventPurchaseResource\Pages;

use App\Filament\Resources\EventPurchaseResource;
use App\Services\Audit\SuperAdminAuditLogger;
use Filament\Actions;
use Filament\Resources\Pages\ViewRecord;

class ViewEventPurchase extends ViewRecord
{
    protected static string $resource = EventPurchaseResource::class;

    protected function getHeaderActions(): array
    {
        return [
            Actions\EditAction::make()
                ->after(fn (array $data, $record) => app(SuperAdminAuditLogger::class)->recordModelMutation(
                    'updated',
                    $record,
                    SuperAdminAuditLogger::fieldsMetadata($data),
                    static::class
                )),
        ];
    }
}
