<?php

namespace Apexl\Io\Component\Components;

use JsonSerializable;

/**
 * @template T
 */
final readonly class ComponentProperty implements JsonSerializable
{
    /**
     * @param string $name
     * @param <T> $value
     */
    public function __construct(
        public string $name,
        public mixed $value,
    ) {}

    /**
     * @return <T>
     */
    public function jsonSerialize(): mixed
    {
        return $this->value;
    }
}
