@namespace Oqtane.Modules.Controls
@inherits LocalizableComponent
@if (!string.IsNullOrEmpty(HelpText))
{
}
else
{
}
@code {
[Parameter]
public RenderFragment ChildContent { get; set; }
[Parameter]
public string For { get; set; } // optional - the id of the associated input control for accessibility
[Parameter]
public string Class { get; set; } // optional - CSS classes
[Parameter]
public string HelpText { get; set; } // optional - tooltip for this label
private string _spanclass = "app-tooltip";
private string _labelclass = "form-label";
private string _helptext = string.Empty;
protected override void OnParametersSet()
{
base.OnParametersSet();
if (!string.IsNullOrEmpty(HelpText))
{
_helptext = Localize(nameof(HelpText), HelpText);
_spanclass += (!string.IsNullOrEmpty(Class)) ? " " + Class : "";
}
else
{
_labelclass += (!string.IsNullOrEmpty(Class)) ? " " + Class : "";
}
var text = Localize("Text", String.Empty);
if (!string.IsNullOrEmpty(text))
{
ChildContent =@@text;
}
}
}