OTP/OTP/Views/FoldersSection.swift

34 lines
790 B
Swift

//
// FoldersSection.swift
// OTP
//
// Created by Shadowfacts on 8/24/21.
//
import SwiftUI
struct FoldersSection: View {
@ObservedObject private var store: KeyStore = .shared
@FocusState private var focusedEdited: Bool
var body: some View {
Section {
ForEach(store.sortedFolders) { (folder) in
FolderRow(store: store, folder: folder)
}
.onDelete { (indices) in
let folderIDs = indices.map { store.sortedFolders[$0].id }
withAnimation {
folderIDs.forEach(store.removeFolder(id:))
}
}
}
}
}
struct FoldersSectionView_Previews: PreviewProvider {
static var previews: some View {
FoldersSection()
}
}