diff options
| author | Ruben Beltran del Rio <jj@r.bdr.sh> | 2026-06-15 14:35:36 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <jj@r.bdr.sh> | 2026-06-16 14:47:30 +0200 |
| commit | 657aa83a5ca24dc35572c040df64a0abb85e8612 (patch) | |
| tree | fe0b6fd425d8cad9dc6a28ada4ad8600e42b367e /Sources/NorgUI/Views/VerbatimBlock.swift | |
Initial extraction from Norganize
Diffstat (limited to 'Sources/NorgUI/Views/VerbatimBlock.swift')
| -rw-r--r-- | Sources/NorgUI/Views/VerbatimBlock.swift | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Sources/NorgUI/Views/VerbatimBlock.swift b/Sources/NorgUI/Views/VerbatimBlock.swift new file mode 100644 index 0000000..722c3f3 --- /dev/null +++ b/Sources/NorgUI/Views/VerbatimBlock.swift @@ -0,0 +1,23 @@ +import SwiftUI + +struct VerbatimBlock: View { + @Environment(\.norgTheme) private var theme + + let label: String? + let content: String + + var body: some View { + VStack(alignment: .leading, spacing: 4) { + if let label, !label.isEmpty { + Text(label) + .font(.caption2) + .foregroundStyle(.secondary) + } + Text(content) + .font(theme.codeFont) + .frame(maxWidth: .infinity, alignment: .leading) + } + .padding(10) + .background(theme.codeBackground, in: RoundedRectangle(cornerRadius: 8)) + } +} |