mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-05-02 20:19:47 +00:00
Defined a supporter component
This commit is contained in:
parent
e419c5561b
commit
81f640f742
18
app/MindWork AI Studio/Components/Supporter.razor
Normal file
18
app/MindWork AI Studio/Components/Supporter.razor
Normal 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>
|
26
app/MindWork AI Studio/Components/Supporter.razor.cs
Normal file
26
app/MindWork AI Studio/Components/Supporter.razor.cs
Normal 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,
|
||||||
|
};
|
||||||
|
}
|
8
app/MindWork AI Studio/Components/SupporterType.cs
Normal file
8
app/MindWork AI Studio/Components/SupporterType.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace AIStudio.Components;
|
||||||
|
|
||||||
|
public enum SupporterType
|
||||||
|
{
|
||||||
|
UNKNOWN,
|
||||||
|
INDIVIDUAL,
|
||||||
|
ORGANIZATION
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user