NetNewsWire/Shared/Extensions/SmallIconProvider.swift

41 lines
766 B
Swift
Raw Normal View History

//
// SmallIconProvider.swift
2018-08-29 07:18:24 +02:00
// NetNewsWire
//
// Created by Brent Simmons on 12/16/17.
// Copyright © 2017 Ranchero Software. All rights reserved.
//
import Foundation
import Articles
import Account
import Images
protocol SmallIconProvider {
@MainActor var smallIcon: IconImage? { get }
}
extension Account: SmallIconProvider {
var smallIcon: IconImage? {
let image = AppAsset.Account.image(for: accountType)
return IconImage(image)
}
}
2024-02-26 06:41:18 +01:00
extension Feed: SmallIconProvider {
2024-03-20 07:05:30 +01:00
@MainActor var smallIcon: IconImage? {
2024-06-27 08:13:54 +02:00
if let iconImage = FaviconDownloader.shared.favicon(for: self) {
return iconImage
}
return FaviconGenerator.favicon(self)
}
}
extension Folder: SmallIconProvider {
var smallIcon: IconImage? {
2024-02-26 17:37:15 +01:00
AppAssets.folderImage
}
}