using Wino.Core.Domain;
using Wino.Core.Domain.Entities.Shared;
namespace Wino.Mail.ViewModels.Data;
public class AccountContactViewModel : AccountContact
{
public AccountContactViewModel(AccountContact contact)
{
Address = contact.Address;
Name = contact.Name;
Base64ContactPicture = contact.Base64ContactPicture;
IsRootContact = contact.IsRootContact;
}
///
/// Gets or sets whether the contact is the current account.
///
public bool IsMe { get; set; }
///
/// Gets or sets whether the ShortNameOrYOu should have semicolon.
///
public bool IsSemicolon { get; set; } = true;
///
/// Provides a short name of the contact.
/// or "You"
///
public string ShortNameOrYou => (IsMe ? Translator.AccountContactNameYou : ShortDisplayName) + (IsSemicolon ? ";" : string.Empty);
///
/// Short display name of the contact.
/// Either Name or Address.
///
public string ShortDisplayName => Address == Name || string.IsNullOrWhiteSpace(Name) ? $"{Address.ToLowerInvariant()}" : $"{Name}";
///
/// Display name of the contact in a format: Name .
///
public string DisplayName => Address == Name || string.IsNullOrWhiteSpace(Name) ? Address.ToLowerInvariant() : $"{Name} <{Address.ToLowerInvariant()}>";
}