summaryrefslogtreecommitdiff
path: root/Sora/Views/Bookmarks/BookmarkListItemView.swift
blob: 6d62893cda81a9676fab772655dd3ed01531839f (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.formatted())
                    .font(.caption)
                    .foregroundStyle(Color.secondary)
            }
        }
        #if os(macOS)
        .padding()
        #endif
    }
}