mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2024-11-24 22:42:53 +01:00
35 lines
819 B
Plaintext
35 lines
819 B
Plaintext
@using Phantom.Server.Web.Components.Utils
|
|
@if (messageLines.Length > 0) {
|
|
<div class="form-submit-errors text-danger">
|
|
@for (int i = 0; i < messageLines.Length; i++) {
|
|
@messageLines[i]
|
|
if (i < messageLines.Length - 1) {
|
|
<br />
|
|
}
|
|
}
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
|
|
[CascadingParameter]
|
|
public Form? Form { get; set; }
|
|
|
|
[Parameter]
|
|
public FormButtonSubmit.SubmitModel? Model { get; set; }
|
|
|
|
[Parameter]
|
|
public string? Message { get; set; }
|
|
|
|
private string[] messageLines = Array.Empty<string>();
|
|
|
|
protected override void OnParametersSet() {
|
|
BlazorUtils.RequireEitherParameterIsSet(Form, Model);
|
|
|
|
var model = Form?.Model.SubmitModel ?? Model;
|
|
var message = model?.SubmitError ?? Message;
|
|
messageLines = message?.Split('\n') ?? Array.Empty<string>();
|
|
}
|
|
|
|
}
|