Improve Alert component

This commit is contained in:
Neil Brommer 2021-12-16 22:16:30 -08:00
parent eda134c471
commit adf24cbd5c

View file

@ -1,4 +1,5 @@
<div class="toast @AlertTypeToClass(this.Type)" role="alert">
<div class="toast @this.AlertTypeToClass(this.Type)" role="alert">
@this.AlertTypeToTitle(this.Type)
@ChildContent
</div>
@ -20,6 +21,23 @@
}
}
private RenderFragment? AlertTypeToTitle(AlertType type)
{
switch (type)
{
case AlertType.Error:
return @<b>Error</b>;
case AlertType.Warning:
return @<b>Warning</b>;
case AlertType.Success:
return @<b>Success</b>;
case AlertType.Info:
return @<b>Info</b>;
default:
return null;
}
}
public enum AlertType
{
Error,