1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 06:10:32 +05:30
yattee/Shared/Navigation/AppSidebarSubscriptions.swift
2022-12-05 10:13:19 +01:00

26 lines
949 B
Swift

import Defaults
import SwiftUI
struct AppSidebarSubscriptions: View {
@ObservedObject private var navigation = NavigationModel.shared
@ObservedObject private var subscriptions = SubscriptionsModel.shared
var body: some View {
Section(header: Text("Subscriptions")) {
ForEach(subscriptions.all) { channel in
NavigationLink(tag: TabSelection.channel(channel.id), selection: $navigation.tabSelection) {
LazyView(ChannelVideosView(channel: channel))
} label: {
Label(channel.name, systemImage: RecentsModel.symbolSystemImage(channel.name))
}
.contextMenu {
Button("Unsubscribe") {
navigation.presentUnsubscribeAlert(channel, subscriptions: subscriptions)
}
}
.id("channel\(channel.id)")
}
}
}
}