mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-11 17:06:46 +01:00
36 lines
707 B
Swift
36 lines
707 B
Swift
//
|
|
// SidebarItemView.swift
|
|
// NetNewsWire
|
|
//
|
|
// Created by Maurice Parker on 6/29/20.
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
import Account
|
|
|
|
struct SidebarItemView: View {
|
|
|
|
@StateObject var feedImageLoader = FeedImageLoader()
|
|
var sidebarItem: SidebarItem
|
|
|
|
var body: some View {
|
|
HStack {
|
|
if let image = feedImageLoader.image {
|
|
IconImageView(iconImage: image)
|
|
}
|
|
Text(verbatim: sidebarItem.nameForDisplay)
|
|
Spacer()
|
|
if sidebarItem.unreadCount > 0 {
|
|
UnreadCountView(count: sidebarItem.unreadCount)
|
|
}
|
|
}
|
|
.onAppear {
|
|
if let feed = sidebarItem.represented as? Feed {
|
|
feedImageLoader.loadImage(for: feed)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|