<?php

namespace App\Filament\Resources\ApiProviders\Pages;

use App\Filament\Resources\ApiProviders\ApiProviderResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use Livewire\Attributes\On;

class EditApiProvider extends EditRecord
{
    public $testResultState = 'none';

    protected static string $resource = ApiProviderResource::class;

    #[On('testConnectionFinished')]
    public function onTestConnectionFinished($result)
    {
        $this->testResultState = $result;
    }

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

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