<?php

declare(strict_types=1);

namespace App\Filament\Resources\DberpCustomerCategories\Pages;

use App\Filament\Resources\DberpCustomerCategories\DberpCustomerCategoryResource;
use App\Filament\Resources\Pages\EditRecord;
use Filament\Actions\DeleteAction;

class EditDberpCustomerCategory extends EditRecord
{
    protected static string $resource = DberpCustomerCategoryResource::class;

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