Neighbourhood.omg.lol/Models/Status.cs

42 lines
1.2 KiB
C#
Raw Normal View History

2024-07-01 23:19:37 +00:00
using Microsoft.AspNetCore.Components;
2024-05-30 01:06:08 +00:00
2024-07-01 23:19:37 +00:00
namespace Neighbourhood.omg.lol.Models
{
public class Status {
2024-07-02 00:29:50 +00:00
public string Id { get; set; } = string.Empty;
public string Address { get; set; } = string.Empty;
public string Created { get; set; } = string.Empty;
public string RelativeTime { get; set; } = string.Empty;
public string Emoji { get; set; } = string.Empty;
public string Background { get; set; } = string.Empty;
2024-06-14 00:45:31 +00:00
public string BackgroundColor { get => Background; set => Background = "#" + value; }
2024-07-02 00:29:50 +00:00
public string Content { get; set; } = string.Empty;
public string RenderedMarkdown { get; set; } = string.Empty;
public string ExternalUrl { get; set; } = string.Empty;
2024-05-30 01:06:08 +00:00
2024-06-28 07:08:12 +00:00
public DateTimeOffset CreatedTime { get => DateTimeOffset.UnixEpoch.AddSeconds(Convert.ToInt64(Created)); }
public string EmojiOrDefault {
get {
return string.IsNullOrEmpty(Emoji) ? "✨" : Emoji;
}
}
public MarkupString HtmlContent {
get => Utilities.MdToHtmlMarkup(Content);
2024-05-30 01:06:08 +00:00
}
public string Url {
get {
return $"https://status.lol/{Address}/{Id}";
}
}
public string UserUrl {
get {
return $"https://status.lol/{Address}";
}
}
}
}