<?php
declare(strict_types=1);

namespace PpPhp\Core\Designer\Component;

final class DesignerComponentCategory
{
    public function __construct(
        private readonly string $categoryId,
        private readonly string $label,
        private readonly string $icon = '',
        private readonly int $order = 100
    ) {}

    public static function create(string $categoryId, string $label, string $icon = '', int $order = 100): self
    {
        return new self($categoryId, $label, $icon, $order);
    }

    public function categoryId(): string { return $this->categoryId; }
    public function order(): int { return $this->order; }

    public function toArray(): array
    {
        return ['categoryId' => $this->categoryId, 'label' => $this->label, 'icon' => $this->icon, 'order' => $this->order];
    }
}
