@inherits ViewModelTemplate<UserViewModel>
@using Dynamicweb.Frontend
@using Dynamicweb.Rendering
@using Dynamicweb.Users.Frontend
@using Dynamicweb.Security.UserManagement

<div class="card h-100 border-0 text-center align-items-center m-auto" itemscope itemtype="https://schema.org/Person">
    @if(Model.TryGetImageFile(out ImageFileViewModel image))
    {
        <figure class="m-0 w-100">
            <img src="@image.ToGetImage(new(){ Width = 400, Ratio = "1/1" })" class="card-img-top shadow" alt="@Model.Name" itemprop="image">
        </figure>
    }
    
    <div class="card-body fs-7">
        @if(!string.IsNullOrEmpty(Model.Name))
        {
            <h3 class="h4 pt-1 mb-2" itemprop="name">@Model.Name</h3>
        }
        @if(!string.IsNullOrEmpty(Model.JobTitle))
        {
            <p class="mb-0 text-muted text-opacity-75" itemprop="jobTitle">@Model.JobTitle</p>
        }
        <div class="border-top mx-auto my-3" style="max-width: 5rem;"></div>
        @if(!string.IsNullOrEmpty(Model.Department))
        {
            <p class="mb-0 text-muted text-opacity-75" itemprop="department">@Model.Department</p>
        }
        @if(!string.IsNullOrEmpty(Model.Company))
        {
            <p class="mb-0 text-muted text-opacity-75" itemprop="worksFor">@Model.Company</p>
        }
        @if(!string.IsNullOrEmpty(Model.Country))
        {
            <p class="mb-0 text-muted text-opacity-75" itemprop="country">@Model.Country</p>
        }
        @if(!string.IsNullOrEmpty(Model.Email))
        {
            <a href="mailto:@Model.Email" itemprop="email">
                <span class="d-block pt-2">@Model.Email</span>
            </a>
        }
        @if(!string.IsNullOrEmpty(Model.PhoneBusiness))
        {
            <a href="tel:@Model.PhoneBusiness" itemprop="telephone">
                <span class="d-block pt-1">@Model.PhoneBusiness</span>
            </a>
        }
    </div>
</div>
