forked from Automattic/pocket-casts-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FilesListView.swift
29 lines (27 loc) · 1 KB
/
FilesListView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import SwiftUI
struct FilesListView: View {
@StateObject var viewModel = FilesListViewModel()
var body: some View {
ItemListContainer(isEmpty: $viewModel.episodes.isEmpty, loading: viewModel.isLoading) {
List {
EpisodeListView(title: L10n.settingsFiles.prefixSourceUnicode, showArtwork: true, episodes: $viewModel.episodes, playlist: .files)
.withOrderPickerToolbar(selectedOption: viewModel.sortOrder, title: L10n.filesSort, supportsToolbar: viewModel.supportsSort) { option in
viewModel.sortOrder = option
}
}
}
.navigationTitle(L10n.settingsFiles.prefixSourceUnicode)
.restorable(.files)
.onAppear {
viewModel.loadUserEpisodes()
}
}
}
struct FilesListView_Previews: PreviewProvider {
static var previews: some View {
ForEach(PreviewDevice.previewDevices) {
FilesListView()
.previewDevice($0)
}
}
}