using Connected.Annotations;
using Connected.Utilities;
using Microsoft.AspNetCore.Components;

namespace Connected.Components;

public partial class CardMedia : UIComponent
{
	protected string StyleString =>
		StyleBuilder.Default($"background-image:url(\"{Image}\");height: {Height}px;")
			.Build();

	protected string Classname =>
		new CssBuilder("card-media")
			.AddClass(AdditionalClassList)
			.Build();

	/// <summary>
	/// GlyphTitle of the image used for accessibility.
	/// </summary>
	[Parameter]
	[Category(CategoryTypes.Card.Behavior)]
	public string Title { get; set; }

	/// <summary>
	/// Specifies the path to the image.
	/// </summary>
	[Parameter]
	[Category(CategoryTypes.Card.Behavior)]
	public string Image { get; set; }

	/// <summary>
	/// Specifies the height of the image in px.
	/// </summary>
	[Parameter]
	[Category(CategoryTypes.Card.Behavior)]
	public int Height { get; set; } = 300;
}
