mirror of
https://github.com/luxwallet/ios.git
synced 2026-10-30 20:33:27 +00:00
34 lines
853 B
Swift
34 lines
853 B
Swift
import SwiftUI
|
|
|
|
struct ListSection<Content: View>: View {
|
|
@ViewBuilder let content: Content
|
|
|
|
var body: some View {
|
|
_VariadicView.Tree(Layout()) {
|
|
content
|
|
}
|
|
}
|
|
|
|
struct Layout: _VariadicView_MultiViewRoot {
|
|
@ViewBuilder func body(children: _VariadicView.Children) -> some View {
|
|
if children.isEmpty {
|
|
EmptyView()
|
|
} else {
|
|
let last = children.last?.id
|
|
|
|
VStack(spacing: 0) {
|
|
VStack(spacing: 0) {
|
|
ForEach(children) { child in
|
|
child
|
|
|
|
if child.id != last {
|
|
HorizontalDivider()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|