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

<div>
    @if (Model.Item.TryGetImageFile("Icon", out ImageFileViewModel image))
    {
        <figure class="icon-4 p-3" style="background-color:var(--bs-body-color);color:var(--bs-body-bg);">
            @if (image.IsSvg())
            {
                @ReadFile(image.Path)
            }
            else
            {
                <img src="@image.ToGetImage(new() { Width = 60 })" alt="@image.Name" height="60" width="60" class="img-fluid" />
            }
        </figure>
    }
    <div data-swift-text class="mb-0-last-child p-0">
        @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 align-items-center">
        @if (Model.Item.TryGetButton("Button", out ButtonViewModel button))
        {
            <a href="@button.Link.Url" class="btn btn-@button.Style" data-dw-button="@button.Style">@button.Label</a>
        }
    </div>
</div>
