aboutsummaryrefslogtreecommitdiff
path: root/Sources/NorgUI/Views/Blocks/QuoteView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Sources/NorgUI/Views/Blocks/QuoteView.swift')
-rw-r--r--Sources/NorgUI/Views/Blocks/QuoteView.swift29
1 files changed, 29 insertions, 0 deletions
diff --git a/Sources/NorgUI/Views/Blocks/QuoteView.swift b/Sources/NorgUI/Views/Blocks/QuoteView.swift
new file mode 100644
index 0000000..0347d78
--- /dev/null
+++ b/Sources/NorgUI/Views/Blocks/QuoteView.swift
@@ -0,0 +1,29 @@
+import NorgKit
+import SwiftUI
+
+struct QuoteView: View {
+ @Environment(\.norgTheme) private var theme
+
+ let status: TaskStatus?
+ let content: [InlineSpan]
+ let line: Int
+ let onSetStatus: (Int, TaskStatus) -> Void
+
+ var body: some View {
+ HStack(alignment: .top, spacing: 8) {
+ RoundedRectangle(cornerRadius: 1.5)
+ .fill(theme.quoteBarColor)
+ .frame(width: 3)
+ if let status {
+ BlockTaskRow(
+ status: status, content: content, font: theme.body, line: line, onSetStatus: onSetStatus
+ )
+ } else {
+ Text(AttributedString(norg: content, theme: theme))
+ .foregroundStyle(theme.quoteColor)
+ .italic()
+ }
+ }
+ .fixedSize(horizontal: false, vertical: true)
+ }
+}