mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-07-04 07:22:56 +00:00
30 lines
707 B
C#
30 lines
707 B
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AIStudio.Components;
|
|
|
|
public partial class CodeTabs : ComponentBase
|
|
{
|
|
[Parameter]
|
|
public RenderFragment? ChildContent { get; set; }
|
|
|
|
private readonly List<CodeTabItem> blocks = new();
|
|
private int selectedIndex;
|
|
|
|
internal void RegisterBlock(string title, RenderFragment fragment)
|
|
{
|
|
this.blocks.Add(new CodeTabItem
|
|
{
|
|
Title = title,
|
|
Fragment = fragment,
|
|
});
|
|
|
|
this.StateHasChanged();
|
|
}
|
|
|
|
private class CodeTabItem
|
|
{
|
|
public string Title { get; init; } = string.Empty;
|
|
|
|
public RenderFragment Fragment { get; init; } = null!;
|
|
}
|
|
} |