// Copyright © Selmo Technology GmbH. All Rights Reserved

using Novus.Shared.Types.IssueHandling;
using SelmoStudio.Hmi.Server.SelmoHmi.Notification.Components;
using SelmoStudio.Hmi.Server.SelmoHmi.Notification.Model;

namespace SelmoStudio.Hmi.Server.SelmoHmi.Notification.Factory
{
    internal static class NotificationConfigurationFactory
    {
        private const Severity ProgressNotificationSeverity = Severity.Info;
        private const double ProgressNotificationMessageDuration = -1; // -1 disables the automatic duration
        private const Severity ErrorNotificationSeverity = Severity.Error;
        private const double ErrorNotificationMessageDuration = 3000;

        internal static NotificationConfiguration CreateProgress()
        {
            return new NotificationConfiguration()
            {
                Id = new(Guid.NewGuid()),
                Severity = ProgressNotificationSeverity,
                MessageDuration = ProgressNotificationMessageDuration,
                Content = typeof(ProgressNotificationContentComponent)
            };
        }

        internal static NotificationConfiguration CreateError()
        {
            return new NotificationConfiguration()
            {
                Id = new(Guid.NewGuid()),
                Severity = ErrorNotificationSeverity,
                MessageDuration = ErrorNotificationMessageDuration,
                Content = typeof(ProgressNotificationContentComponent)
            };
        }
    }
}