1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-15 23:00:32 +05:30
yattee/Apple TV/CoverSectionView.swift
2021-07-08 17:16:42 +02:00

36 lines
732 B
Swift

import SwiftUI
struct CoverSectionView<Content: View>: View {
let title: String?
let rowsView: Content
let divider: Bool
init(_ title: String? = nil, divider: Bool = true, @ViewBuilder rowsView: @escaping () -> Content) {
self.title = title
self.divider = divider
self.rowsView = rowsView()
}
var body: some View {
VStack(alignment: .leading) {
if title != nil {
sectionTitle
}
rowsView
}
if divider {
Divider()
.padding(.vertical)
}
}
var sectionTitle: some View {
Text(title ?? "")
.font(.title3)
.padding(.bottom)
}
}