Files
FoodsharingOnboarding/FoodsharingSiegen.Server/Controls/ProspectContainer.razor.cs
2025-03-28 18:49:38 +01:00

35 lines
1.1 KiB
C#

using FoodsharingSiegen.Contracts.Entity;
using FoodsharingSiegen.Server.Dialogs;
using Microsoft.AspNetCore.Components;
namespace FoodsharingSiegen.Server.Controls
{
public partial class ProspectContainer
{
[Parameter] public Prospect? Prospect { get; set; }
[Parameter] public AddInteractionModal InteractionModal { get; set; } = null!;
[Parameter] public Func<Guid, Task>? RemoveInteraction { get; set; }
[Parameter] public ProspectStateFilter StateFilter { get; set; }
[Parameter] public string? CssClass { get; set; }
private async Task AddInteraction(InteractionType type)
{
await InteractionModal.ShowAsync(type, Prospect?.Id);
}
private List<Interaction> GetTyped(InteractionType type)
{
return Prospect?.Interactions?.Where(x => x.Type == type).ToList() ?? [];
}
private async Task EditProspectAsync()
{
await EditProspectDialog.ShowAsync(ModalService, () => InvokeAsync(StateHasChanged), Prospect);
}
}
}