@using Koogle.Application.DTOs @using Koogle.Domain.Enums GIF von URL importieren Ereignisse zuweisen Abbrechen Importieren @code { [CascadingParameter] IMudDialogInstance MudDialog { get; set; } = null!; private string _url = ""; private string _name = ""; private string _description = ""; private bool _strike, _circle, _bell, _gutter, _noWood; private bool IsValid => !string.IsNullOrWhiteSpace(_url) && !string.IsNullOrWhiteSpace(_name) && (_strike || _circle || _bell || _gutter || _noWood) && Uri.TryCreate(_url, UriKind.Absolute, out _); private ThrowEventType GetEvents() { var events = ThrowEventType.None; if (_strike) events |= ThrowEventType.Strike; if (_circle) events |= ThrowEventType.Circle; if (_bell) events |= ThrowEventType.Bell; if (_gutter) events |= ThrowEventType.Gutter; if (_noWood) events |= ThrowEventType.NoWood; return events; } private void Submit() { var dto = new ImportClubGifDto { Name = _name, SourceUrl = _url, AssignedEvents = GetEvents(), Description = string.IsNullOrWhiteSpace(_description) ? null : _description }; MudDialog.Close(DialogResult.Ok(dto)); } private void Cancel() => MudDialog.Cancel(); }