// // ListVStack.swift // Nextcloud Cookbook iOS Client // // Created by Vincent Meilinger on 29.05.25. // import SwiftUI struct ListVStack: View { @Binding var items: [Element] let header: () -> HeaderContent let rows: (Int, Binding) -> RowContent init(_ items: Binding<[Element]>, header: @escaping () -> HeaderContent, rows: @escaping (Int, Binding) -> RowContent) { self._items = items self.header = header self.rows = rows } var body: some View { VStack(alignment: .leading) { header() .padding(.horizontal, 30) VStack(alignment: .leading, spacing: 0) { ForEach(items.indices, id: \.self) { index in rows(index, $items[index]) .padding(10) } } .padding(4) .background(Color.secondary.opacity(0.1)) .clipShape(RoundedRectangle(cornerRadius: 15)) .padding(.horizontal) } } }