Watch next improvements, clear queue buttons

This commit is contained in:
Arkadiusz Fal
2022-12-21 18:21:44 +01:00
parent 18cbbd3c90
commit c01ff56854
5 changed files with 138 additions and 71 deletions

View File

@@ -0,0 +1,31 @@
import SwiftUI
struct ClearQueueButton: View {
private var navigation = NavigationModel.shared
var body: some View {
Button {
navigation.presentAlert(
Alert(
title: Text("Are you sure you want to clear the queue?"),
primaryButton: .destructive(Text("Clear All")) {
PlayerModel.shared.removeQueueItems()
},
secondaryButton: .cancel()
)
)
} label: {
Label("Clear Queue", systemImage: "trash")
.font(.headline)
.labelStyle(.iconOnly)
.foregroundColor(.secondary)
}
.buttonStyle(.plain)
}
}
struct ClearQueueButton_Previews: PreviewProvider {
static var previews: some View {
ClearQueueButton()
}
}