summaryrefslogtreecommitdiff
path: root/Sora/Views/Bookmarks/BookmarkListItemView.swift
blob: 611c9fef072f76c6ae1c2fa3712f16bb9efb7c4d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import SwiftUI

struct BookmarkListItemView: View {
  @EnvironmentObject var settings: Settings
  var bookmark: Bookmark

  var body: some View {
    VStack(alignment: .leading) {
      HStack {
        Text(bookmark.tags.joined(separator: ", "))

        #if os(macOS)
          Spacer()

          Button {
            settings.removeBookmark(withID: bookmark.id)
          } label: {
            Image(systemName: "trash")
          }
        #endif
      }

      HStack {
        Text(bookmark.createdAt, style: .date)
          .font(.caption)
          .foregroundStyle(Color.secondary)

        Spacer()

        Text(bookmark.provider.rawValue)
          .font(.caption)
          .foregroundStyle(Color.secondary)
      }
    }
    #if os(macOS)
      .padding()
    #endif
  }
}