@using DysonNetwork.Shared.Models
@model DysonNetwork.Shared.Models.SnPublisher

@{
    const string defaultAvatar = "https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp";
}

<div class="card bg-base-200 shadow-md">
    @if (Model.Background != null)
    {
        <figure class="relative">
            <img
                src="/drive/files/@Model.Background.Id"
                alt="Background"/>
        </figure>
    }
    <div class="card-body">
        <div class="flex gap-4 card-title">
            <div class="avatar">
                <div class="w-16 rounded-full">
                    <img
                        src="@(Model.Picture is null ? defaultAvatar : "/drive/files/" + Model.Picture!.Id)"
                        alt="Avatar"/>
                </div>
            </div>
            <h2 class="flex-1 flex flex-col">
                @Model.Nick
                <span class="text-xs">@@@Model.Name</span>
            </h2>
        </div>
        @if (!string.IsNullOrWhiteSpace(Model.Bio))
        {
            <p>@Model.Bio</p>
        }
    </div>
</div>