<?php

namespace App\Filament\Resources\CreditProducts\Pages;

use App\Filament\Resources\CreditProducts\CreditProductResource;
use Filament\Actions\DeleteAction;
use Filament\Resources\Pages\EditRecord;

class EditCreditProduct extends EditRecord
{
    protected static string $resource = CreditProductResource::class;

    protected function getHeaderActions(): array
    {
        return [
            CreditProductResource::syncStripeAction(),
            DeleteAction::make(),
        ];
    }

    protected function afterSave(): void
    {
        app(\App\Services\StripeCreditProductSyncer::class)->sync($this->record);
    }
}
