AI-Studio/app/MindWork AI Studio/Components/CodeTabs.razor.cs

30 lines
707 B
C#
Raw Normal View History

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!;
}
}