using Microsoft.CodeAnalysis;

namespace RobotNet.WebApp.Scripts.Models;

public class ConsoleItemModel(DiagnosticSeverity severity, string message)
{
    public string Message { get; private set; } = message;
    public DiagnosticSeverity Severity { get; private set; } = severity;

    public event Action? Changed;

    public void Append(string message)
    {
        this.Message = $"{Message}{Environment.NewLine}{message}";
        Changed?.Invoke();
    }
}
