<?php

declare(strict_types=1);

namespace App\Framework\LiveComponents\Attributes;

use Attribute;

/**
 * Marks a class as a LiveComponent and defines its name
 *
 * The name will be used in URLs and client-side instead of the full class name
 * for better security and cleaner URLs.
 *
 * @example #[LiveComponent('counter')]
 */
#[Attribute(Attribute::TARGET_CLASS)]
final readonly class LiveComponent
{
    public function __construct(
        public string $name
    ) {
    }
}
