ReadKeep/readeck/UI/Labels/LabelsView.swift
Ilyas Hallak e68959afce Refactor: Move Utils to UI/Utils, improve SpeechPlayer UI, enhance state management, remove legacy files, and optimize queue handling
- Move and replace utility files (SafariUtil, SpeechQueue, StringExtensions, TTSManager, VoiceManager)
- Refactor and extend SpeechPlayer components (UI, progress, volume, queue)
- Improved state and EnvironmentObject management (PlayerUIState)
- UI and logic optimizations in menu and tab views
- Remove obsolete and duplicate files
- General code and UX improvements
2025-07-14 21:34:39 +02:00

40 lines
1.3 KiB
Swift

import SwiftUI
struct LabelsView: View {
@State var viewModel = LabelsViewModel()
@State private var selectedTag: String? = nil
@State private var selectedBookmark: Bookmark? = nil
var body: some View {
VStack(alignment: .leading) {
if viewModel.isLoading {
ProgressView()
} else if let errorMessage = viewModel.errorMessage {
Text("Fehler: \(errorMessage)")
.foregroundColor(.red)
} else {
List {
ForEach(viewModel.labels, id: \.href) { label in
NavigationLink {
BookmarksView(state: .all, type: [], selectedBookmark: .constant(nil), tag: label.name)
.navigationTitle("\(label.name) (\(label.count))")
} label: {
HStack {
Text(label.name)
Spacer()
Text("\(label.count)")
.foregroundColor(.secondary)
}
}
}
}
}
}
.onAppear {
Task {
await viewModel.loadLabels()
}
}
}
}