// Copyright © Selmo Technology GmbH. All Rights Reserved

using Microsoft.AspNetCore.Components;
using SelmoStudio.Hmi.Server.Alarms.Model;
using SelmoStudio.Hmi.Server.Alarms.Model.Dto;

namespace SelmoStudio.Hmi.Server.Alarms.Components
{
    /// <summary>
    /// This component represents a list of alarms. The list is provided as a parameter.
    /// ATTENTION: This list is not sorting automatically. The parent component should take care of sorting and ordering the items.
    /// </summary>
    public partial class AlarmListComponent
    {
        [Parameter]
        public string Id { get; set; }

        [Parameter]
        public IList<Alarm> Alarms { get; set; }

        [Inject]
        private NavigationManager _navigationManager { get; set; }

        private void ClickAlarm(Alarm alarm)
        {
            //CHANGE
            _navigationManager.NavigateTo("selmoDiagnose", forceLoad: true);
        }
    }
}