@model JobsMedical.Web.Pages.Employer.ListingsModel.Applicant
@{
    var s = Model.Status;
    var nm = (Model.Name ?? Model.Phone).Trim();
    var initial = nm.Length > 0 ? nm.Substring(0, 1) : "؟";
}
<li class="applicant-row">
    <span class="avatar-sm">
        @if (Model.HasAvatar)
        {
            <img src="/avatar/@Model.UserId" alt="" />
        }
        else
        {
            <span class="avatar-fallback">@initial</span>
        }
    </span>
    <span class="applicant-info">
        <span>@(Model.Name ?? "کاربر") — <span dir="ltr">@JalaliDate.ToPersianDigits(Model.Phone)</span></span>
        @if (Model.HasResume)
        {
            <a href="/resume/@Model.UserId" target="_blank" class="resume-link">📎 مشاهده رزومه</a>
        }
    </span>
    <span class="applicant-actions">
        @if (s == JobsMedical.Web.Models.ApplicationStatus.Accepted)
        {
            <span class="badge badge-verified">✓ پذیرفته شد</span>
        }
        else if (s == JobsMedical.Web.Models.ApplicationStatus.Rejected)
        {
            <span class="badge badge-gender">رد شد</span>
        }
        else
        {
            <form method="post" asp-page-handler="Accept" asp-route-eventId="@Model.EventId" style="display:inline;">
                <button type="submit" class="btn btn-accent" style="padding:3px 12px; font-size:12px;">پذیرفتن</button>
            </form>
            <form method="post" asp-page-handler="Reject" asp-route-eventId="@Model.EventId" style="display:inline;">
                <button type="submit" class="btn btn-outline" style="padding:3px 12px; font-size:12px; color:var(--danger); border-color:var(--danger);">رد</button>
            </form>
        }
    </span>
</li>
