Defined a supporter component

This commit is contained in:
Thorsten Sommer 2024-11-02 11:38:30 +01:00
parent e419c5561b
commit 81f640f742
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<MudListItem T="string" Icon="@this.Icon">
@if (string.IsNullOrWhiteSpace(this.URL))
{
<MudText Typo="Typo.body1" Inline="@true">
@this.Name
</MudText>
}
else
{
<MudLink Href="@this.URL" Target="_blank">
@this.Name
</MudLink>
}
<MudText Typo="Typo.body1" Class="ml-3" Inline="@true">
@this.Acknowledgment
</MudText>
</MudListItem>

View File

@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Components;
namespace AIStudio.Components;
public partial class Supporter : ComponentBase
{
[Parameter]
public string Name { get; set; } = string.Empty;
[Parameter]
public string Acknowledgment { get; set; } = string.Empty;
[Parameter]
public string? URL { get; set; }
[Parameter]
public SupporterType Type { get; set; }
private string Icon => this.Type switch
{
SupporterType.INDIVIDUAL => Icons.Material.Filled.Person,
SupporterType.ORGANIZATION => Icons.Material.Filled.Business,
_ => Icons.Material.Filled.Person4,
};
}

View File

@ -0,0 +1,8 @@
namespace AIStudio.Components;
public enum SupporterType
{
UNKNOWN,
INDIVIDUAL,
ORGANIZATION
}