<?php

declare(strict_types=1);

namespace App\Support\BackupHealth;

final readonly class BackupHealthDashboardSignal
{
    public function __construct(
        public string $title,
        public string $body,
        public string $tone,
        public ?string $badge = null,
        public ?string $badgeColor = null,
        public ?BackupHealthActionTarget $actionTarget = null,
        public bool $actionDisabled = false,
        public ?string $helperText = null,
        public ?string $actionLabel = null,
        public ?string $supportingMessage = null,
    ) {}

    /**
     * @return array{
     *     title: string,
     *     body: string,
     *     badge: string|null,
     *     badgeColor: string|null,
     *     actionLabel: string|null,
     *     actionDisabled: bool,
     *     helperText: string|null,
     *     supportingMessage: string|null
     * }
     */
    public function toArray(): array
    {
        return [
            'title' => $this->title,
            'body' => $this->body,
            'badge' => $this->badge,
            'badgeColor' => $this->badgeColor,
            'actionLabel' => $this->actionLabel,
            'actionDisabled' => $this->actionDisabled,
            'helperText' => $this->helperText,
            'supportingMessage' => $this->supportingMessage,
        ];
    }
}
