@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
@using Dynamicweb.Frontend

<div class="card h-100">
	<figure class="m-0 position-relative">
		@if (Model.Item.TryGetImageFile("Image", out ImageFileViewModel image)) {
			<img src="@image.ToGetImage(new(){ Width = 650 })" class="card-img-top" alt="@Model.Item?.GetString("AltText")" />
		}
		@if (Model.Item.TryGetLink("ImageLink", out LinkViewModel link)) {
			<a href="@link.Url" class="stretched-link" title="@link.Url"></a>
		}
	</figure>
	<div class="card-body">
		<div data-swift-text class="mb-0-last-child">
			@if (Model.Item.TryGetString("Title", out string title))
			{
				@title
			}
			@if (Model.Item.TryGetString("Text", out string text))
			{
				@text
			} 
		</div>
		<div class="d-flex flex-wrap gap-2 align-items-center">
			@if (Model.Item.TryGetButton("FirstButton", out ButtonViewModel firstButton)) {
				<a href="@firstButton.Link.Url" class="btn btn-@firstButton.Style" data-dw-button="@firstButton.Style">@firstButton.Label</a>
			}
			@if (Model.Item.TryGetButton("SecondButton", out ButtonViewModel secondButton)) {
				<a href="@secondButton.Link.Url" class="btn btn-@secondButton.Style" data-dw-button="@secondButton.Style">@secondButton.Label</a>
			}
		</div>
	</div>
</div>
