@if (SmallText.Length > 0) {
@SmallText
@Text
}
else {
@Text
}
@code {
///
/// Gets or sets the URL that the hyperlink points to.
///
[Parameter]
public string Href { get; set; } = string.Empty;
///
/// Gets or sets the main text of the button.
///
[Parameter]
public string Text { get; set; } = string.Empty;
///
/// Gets or sets the text that should appear when the screen is small (optional). If not set, the main text will be used.
///
[Parameter]
public string SmallText { get; set; } = string.Empty;
///
/// Gets or sets the color theme of the button.
///
[Parameter]
public string Color { get; set; } = "primary";
///
/// Gets or sets additional CSS classes to apply to the button.
///
[Parameter]
public string AdditionalClasses { get; set; } = string.Empty;
///
/// Gets the CSS classes for the link button based on the color and additional classes.
///
/// A string containing the CSS classes for the link button.
private string GetButtonClasses()
{
var colorClasses = ButtonStyles.GetColorClasses(Color);
return $"{ButtonStyles.BaseClasses} {colorClasses} {AdditionalClasses}".Trim();
}
}