<?php

declare(strict_types=1);

namespace App\Filament\Resources\DberpSupplierCategories\Pages;

use App\Filament\Resources\DberpSupplierCategories\DberpSupplierCategoryResource;
use App\Filament\Resources\Pages\EditRecord;
use Filament\Actions\DeleteAction;

class EditDberpSupplierCategory extends EditRecord
{
    protected static string $resource = DberpSupplierCategoryResource::class;

    protected function getHeaderActions(): array
    {
        return [
            DeleteAction::make()
                ->visible(fn (): bool => (int) $this->getRecord()->suppliers_count === 0),
        ];
    }
}
