diff options
Diffstat (limited to 'Sources/NorgUI/Views/Blocks/RangeableBlockView.swift')
| -rw-r--r-- | Sources/NorgUI/Views/Blocks/RangeableBlockView.swift | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Sources/NorgUI/Views/Blocks/RangeableBlockView.swift b/Sources/NorgUI/Views/Blocks/RangeableBlockView.swift new file mode 100644 index 0000000..433d89e --- /dev/null +++ b/Sources/NorgUI/Views/Blocks/RangeableBlockView.swift @@ -0,0 +1,22 @@ +import NorgKit +import SwiftUI + +struct RangeableBlockView: View { + @Environment(\.norgTheme) private var theme + + let title: [InlineSpan] + let status: TaskStatus? + let line: Int + let onSetStatus: (Int, TaskStatus) -> Void + + var body: some View { + if let status { + BlockTaskRow( + status: status, content: title, font: theme.termFont, line: line, onSetStatus: onSetStatus + ) + } else { + Text(AttributedString(norg: title, baseFont: theme.termFont, theme: theme)) + .font(theme.termFont) + } + } +} |