- Add BookmarkState enum with unread, favorite, and archived states - Extend API layer with query parameter filtering for bookmark states - Update Bookmark domain model to match complete API response schema - Implement BookmarkListView with card-based UI and preview images - Add BookmarkListViewModel with state management and error handling - Enhance BookmarkDetailView with meta information and WebView rendering - Create comprehensive DTO mapping for all bookmark fields - Add TabView with state-based bookmark filtering - Implement date formatting utilities for ISO8601 timestamps - Add progress indicators and pull-to-refresh functionality
68 lines
1.6 KiB
Swift
68 lines
1.6 KiB
Swift
import SwiftUI
|
|
import Foundation
|
|
|
|
enum BookmarkState: String, CaseIterable {
|
|
case unread = "unread"
|
|
case favorite = "favorite"
|
|
case archived = "archived"
|
|
|
|
var displayName: String {
|
|
switch self {
|
|
case .unread:
|
|
return "Ungelesen"
|
|
case .favorite:
|
|
return "Favoriten"
|
|
case .archived:
|
|
return "Archiv"
|
|
}
|
|
}
|
|
|
|
var systemImage: String {
|
|
switch self {
|
|
case .unread:
|
|
return "house"
|
|
case .favorite:
|
|
return "heart"
|
|
case .archived:
|
|
return "archivebox"
|
|
}
|
|
}
|
|
}
|
|
|
|
struct MainTabView: View {
|
|
@State private var selectedTab: String = "Ungelesen"
|
|
|
|
var body: some View {
|
|
TabView(selection: $selectedTab) {
|
|
BookmarksView(state: .unread)
|
|
.tabItem {
|
|
Label("Ungelesen", systemImage: "house")
|
|
}
|
|
.tag("Ungelesen")
|
|
|
|
BookmarksView(state: .favorite)
|
|
.tabItem {
|
|
Label("Favoriten", systemImage: "heart")
|
|
}
|
|
.tag("Favoriten")
|
|
|
|
BookmarksView(state: .archived)
|
|
.tabItem {
|
|
Label("Archiv", systemImage: "archivebox")
|
|
}
|
|
.tag("Archiv")
|
|
|
|
SettingsView()
|
|
.tabItem {
|
|
Label("Settings", systemImage: "gear")
|
|
}
|
|
.tag("Settings")
|
|
}
|
|
.accentColor(.blue)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
MainTabView()
|
|
}
|