yattee/Shared/Playlists/CoverSectionRowView.swift

21 lines
438 B
Swift
Raw Normal View History

2021-07-07 22:39:18 +00:00
import SwiftUI
struct CoverSectionRowView<ControlContent: View>: View {
2021-07-08 15:14:54 +00:00
let label: String?
let controlView: ControlContent
2021-07-07 22:39:18 +00:00
init(_ label: String? = nil, @ViewBuilder controlView: @escaping () -> ControlContent) {
2021-07-07 22:39:18 +00:00
self.label = label
self.controlView = controlView()
}
var body: some View {
HStack {
2021-07-08 15:14:54 +00:00
Text(label ?? "")
2021-07-07 22:39:18 +00:00
Spacer()
controlView
}
}
}