mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Watch next improvements, clear queue buttons
This commit is contained in:
31
Shared/Views/ClearQueueButton.swift
Normal file
31
Shared/Views/ClearQueueButton.swift
Normal 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()
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user