๐Ÿ“ฆ sleepyfran / duets

๐Ÿ“„ Post.fs ยท 23 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23[<AutoOpen>]
module Duets.Cli.Components.Post

open Duets.Cli.Text
open Duets.Entities
open Spectre.Console

/// Shows a social network post posted by the given account.
let showPost (account: SocialNetworkAccount) (post: SocialNetworkPost) =
    Panel(
        Rows(
            Markup(
                $"@{account.Handle} | {Generic.dateWithDay post.Timestamp}"
                |> Styles.faded
            ),
            Text(post.Text),
            Markup($"{Emoji.boost} {post.Reposts}")
        ),
        Border = BoxBorder.Rounded,
        Expand = true
    )
    |> AnsiConsole.Write