@using Indotalent.Features.Pipeline.LeadContact.Cqrs @using Indotalent.Shared.Utils @using MudBlazor @inject LeadContactService LeadContactService @inject ISnackbar Snackbar Add Lead Contact Create a new contact entry for your pipeline. Basic Information Full Name Lead @foreach (var item in _lookup.Leads) { @item.Name } Description Address Info Street Address City State Zip Code Country Contact Details Phone Number Fax Number Mobile Number Email Address Website Digital Presence WhatsApp LinkedIn Facebook Twitter Instagram Cancel @if (_processing) { Processing... } else { Create Contact } @code { [Parameter] public EventCallback OnCancel { get; set; } [Parameter] public EventCallback OnSuccess { get; set; } private MudForm _form = default!; private CreateLeadContactValidator _validator = new(); private CreateLeadContactRequest _model = new(); private bool _processing = false; private LeadContactLookupResponse _lookup = new(); protected override async Task OnInitializedAsync() { var res = await LeadContactService.GetLeadContactLookupAsync(); if (res != null && res.IsSuccess) { _lookup = res.Value ?? new(); } } private async Task Submit() { await _form.Validate(); if (!_form.IsValid) return; _processing = true; try { var res = await LeadContactService.CreateLeadContactAsync(_model); await Task.Delay(500); if (res != null && res.IsSuccess) { Snackbar.Add("Created successfully", Severity.Success); await OnSuccess.InvokeAsync(); } } finally { _processing = false; } } }