using FoodsharingSiegen.Contracts.Entity; using Microsoft.AspNetCore.Components; namespace FoodsharingSiegen.Server.Controls { /// /// The interaction row class (a. beging, 31.05.2022) /// public partial class InteractionRow { #region Parameters /// /// Gets or sets the value of the add click (ab) /// [Parameter] public EventCallback AddClick { get; set; } /// /// Gets or sets the value of the allow add interaction (ab) /// [Parameter] public bool AllowAddInteraction { get; set; } /// /// Gets or sets the value of the button text (ab) /// [Parameter] public string? ButtonText { get; set; } /// /// Gets or sets the value of the caption (ab) /// [Parameter] public string? Caption { get; set; } /// /// Gets or sets the value of the icon class (ab) /// [Parameter] public string? IconClass { get; set; } /// /// Gets or sets the value of the minimum (ab) /// [Parameter] public int Minimum { get; set; } = 1; /// /// Gets or sets the value of the multiple (ab) /// [Parameter] public bool Multiple { get; set; } /// /// Gets or sets the value of the prospect (ab) /// [Parameter] public Prospect? Prospect { get; set; } /// /// Gets or sets the value of the remove click (ab) /// [Parameter] public EventCallback RemoveClick { get; set; } /// /// Gets or sets the value of the type (ab) /// [Parameter] public InteractionType Type { get; set; } #endregion #region Private Properties /// /// Gets the value of the alert (ab) /// private bool Alert => Interactions.Any(x => x.Alert); /// /// Gets the value of the done (ab) /// private bool Done => Interactions.Count >= Minimum; /// /// Gets the value of the interactions (ab) /// private List Interactions => Prospect?.Interactions?.Where(x => x.Type == Type).ToList() ?? new List(); /// /// Gets the value of the not needed (ab) /// private bool NotNeeded => Interactions.Any(x => x.NotNeeded); #endregion } }