aboutsummaryrefslogtreecommitdiff
path: root/Sources/NorgUI/Views/VerbatimBlock.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <jj@r.bdr.sh>2026-06-15 14:35:36 +0200
committerRuben Beltran del Rio <jj@r.bdr.sh>2026-06-16 14:47:30 +0200
commit657aa83a5ca24dc35572c040df64a0abb85e8612 (patch)
treefe0b6fd425d8cad9dc6a28ada4ad8600e42b367e /Sources/NorgUI/Views/VerbatimBlock.swift
Initial extraction from Norganize
Diffstat (limited to 'Sources/NorgUI/Views/VerbatimBlock.swift')
-rw-r--r--Sources/NorgUI/Views/VerbatimBlock.swift23
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))
+ }
+}