<?php

declare(strict_types=1);

namespace App\Support\References;

final readonly class ReferenceLinkTarget
{
    public function __construct(
        public string $targetKind,
        public string $url,
        public string $actionLabel,
        public ?string $contextBadge = null,
    ) {}

    /**
     * @return array{targetKind: string, url: string, actionLabel: string, contextBadge: ?string}
     */
    public function toArray(): array
    {
        return [
            'targetKind' => $this->targetKind,
            'url' => $this->url,
            'actionLabel' => $this->actionLabel,
            'contextBadge' => $this->contextBadge,
        ];
    }
}
