using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;

namespace CardSample.Components
{
    public partial class Card : ComponentBase
    {
        [Parameter] public CardItem Item { get; set; }
        [Inject] NavigationManager NavigationManager { get; set; }
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();
        }
        public void ClickAction(CardButton button)
        {
            NavigationManager.NavigateTo(button.ActionUrl);
        }
    }
    public class CardItem
    {
        public string AvatarSrc { get; set; }

        public string Title { get; set; }

        public string SubTitle { get; set; }

        public string ImageSrc { get; set; }

        public List<CardButton> Buttons { get; set; }

        public string TempComment { get; set; }
    }

    public class CardButton
    {
        public string Class { get; set; }
        public string Title { get; set; }
        public string Icon { get; set; }
        public string ActionUrl { get; set; }
        public Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.MouseEventArgs> OnClick
        {
            get;
            set;
        }
    }
}
