CHResume/ResumeBuilder/Main Elements/TitledTextSection.swift
Christoph Hagen bd87a4fb6f First version
2023-08-18 22:47:24 +02:00

33 lines
812 B
Swift

import SwiftUI
struct TitledTextSection: View {
let content: Titled<String>
let titleSpacing: CGFloat
let paragraphSpacing: CGFloat
var body: some View {
TitledSection(title: content.title, spacing: titleSpacing) {
ForEach(content.items) { text in
Text(text)
.font(.body)
.fontWeight(.light)
.padding(.bottom, paragraphSpacing)
}
}
}
}
struct TitledTextSection_Previews: PreviewProvider {
static var previews: some View {
TitledTextSection(
content: .init(
title: "Title",
items: ["Some longer or shorter text to explain some feature."]),
titleSpacing: 10,
paragraphSpacing: 5)
}
}