@model AvatarViewModel
@{
    var imagePath = !string.IsNullOrWhiteSpace(Model.ThumbnailPath) ? Model.ThumbnailPath : Model.ImagePath;
    var cssClass = $"visual-avatar visual-avatar--{Model.Size} {Model.CssClass}".Trim();
}

<span class="@cssClass" title="@Model.DisplayName">
    @if (!string.IsNullOrWhiteSpace(imagePath))
    {
        <img src="@imagePath" alt="" loading="@(Model.Lazy ? "lazy" : "eager")" />
    }
    else
    {
        <span>@AvatarHelper.Initials(Model.DisplayName)</span>
    }
</span>
