@* Copyright (c) Microsoft. All rights reserved. *@
@if (CurrentTab == "preview")
{
@PreviewContent
}
else if (CurrentTab == "code")
{
@CodeContent
}
else if (CurrentTab == "docs")
{
@DocsContent
}
@code {
///
/// Gets or sets the currently active tab.
///
[Parameter]
public string CurrentTab { get; set; } = "preview";
///
/// Gets or sets the callback for tab changes.
///
[Parameter]
public EventCallback OnTabChange { get; set; }
///
/// Gets or sets the content for the Preview tab.
///
[Parameter]
public RenderFragment? PreviewContent { get; set; }
///
/// Gets or sets the content for the Code tab.
///
[Parameter]
public RenderFragment? CodeContent { get; set; }
///
/// Gets or sets the content for the Docs tab.
///
[Parameter]
public RenderFragment? DocsContent { get; set; }
private async Task OnTabChanged(string tab)
{
CurrentTab = tab;
await OnTabChange.InvokeAsync(tab);
}
}