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

<div data-swift-text class="mb-0-last-child">
	@if (Model.Item.TryGetString("Eyebrow", out string eyebrow)) {
		@eyebrow
	}
	@if (Model.Item.TryGetString("Title", out string title)) {
		@title
	}
</div>

@if (Model.Item.TryGetImageFile("Image", out ImageFileViewModel image)) {
	if (image.IsSvg()) {
		<figure class="d-flex align-items-center justify-content-center m-0 position-relative">
			@ReadFile(image.Path)
			@if (Model.Item.TryGetLink("ImageLink", out LinkViewModel link)) {
				<a href="@link.Url" class="stretched-link" title="@link.Url"></a>
			}
		</figure>	
	}
	else {
		<figure class="m-0 position-relative">
			<img src="@image.ToGetImage()" class="img-fluid" 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 data-swift-text class="mb-0-last-child">
	@if (Model.Item.TryGetString("Subtitle", out string subtitle)) {
		@subtitle
	}
	@if (Model.Item.TryGetString("Text", out string text)) {
		@text
	}
	<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>
