2024-05-30 01:06:08 +00:00
|
|
|
|
using Markdig;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
|
|
|
|
namespace Neighbourhood.omg.lol.Models {
|
|
|
|
|
public class Status {
|
|
|
|
|
public string Id { get; set; }
|
|
|
|
|
public string Address { get; set; }
|
|
|
|
|
public string Created { get; set; }
|
|
|
|
|
public string RelativeTime { get; set; }
|
|
|
|
|
public string Emoji { get; set; }
|
|
|
|
|
public string Background { get; set; }
|
2024-06-14 00:45:31 +00:00
|
|
|
|
public string BackgroundColor { get => Background; set => Background = "#" + value; }
|
2024-05-30 01:06:08 +00:00
|
|
|
|
public string Content { get; set; }
|
|
|
|
|
public string RenderedMarkdown { get; set; }
|
|
|
|
|
public string ExternalUrl { get; set; }
|
|
|
|
|
|
2024-06-28 07:08:12 +00:00
|
|
|
|
public DateTimeOffset CreatedTime { get => DateTimeOffset.UnixEpoch.AddSeconds(Convert.ToInt64(Created)); }
|
|
|
|
|
|
2024-05-31 01:27:01 +00:00
|
|
|
|
public string EmojiOrDefault {
|
|
|
|
|
get {
|
|
|
|
|
return string.IsNullOrEmpty(Emoji) ? "✨" : Emoji;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-14 07:20:04 +00:00
|
|
|
|
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}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|