30 lines
705 B
Swift
30 lines
705 B
Swift
import SwiftUI
|
|
|
|
struct DetailListItem<Content>: View where Content: View {
|
|
|
|
private let alignment: VerticalAlignment
|
|
|
|
private let spacing: CGFloat?
|
|
|
|
private let content: Content
|
|
|
|
init(alignment: VerticalAlignment = .center,
|
|
spacing: CGFloat? = nil,
|
|
@ViewBuilder content: () -> Content) {
|
|
self.alignment = alignment
|
|
self.spacing = spacing
|
|
self.content = content()
|
|
}
|
|
|
|
var body: some View {
|
|
HStack(alignment: alignment,
|
|
spacing: spacing) {
|
|
content
|
|
}
|
|
.padding(.horizontal)
|
|
.padding(.vertical)
|
|
.background(Color(NSColor.windowBackgroundColor))
|
|
.cornerRadius(8)
|
|
}
|
|
}
|