From 657aa83a5ca24dc35572c040df64a0abb85e8612 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Mon, 15 Jun 2026 14:35:36 +0200 Subject: Initial extraction from Norganize --- Sources/NorgUI/Views/Blocks/ListItemView.swift | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Sources/NorgUI/Views/Blocks/ListItemView.swift (limited to 'Sources/NorgUI/Views/Blocks/ListItemView.swift') diff --git a/Sources/NorgUI/Views/Blocks/ListItemView.swift b/Sources/NorgUI/Views/Blocks/ListItemView.swift new file mode 100644 index 0000000..581974b --- /dev/null +++ b/Sources/NorgUI/Views/Blocks/ListItemView.swift @@ -0,0 +1,27 @@ +import NorgKit +import SwiftUI + +struct ListItemView: View { + @Environment(\.norgTheme) private var theme + + let marker: String + let status: TaskStatus? + let content: [InlineSpan] + let line: Int + let onSetStatus: (Int, TaskStatus) -> Void + + var body: some View { + HStack(alignment: .firstTextBaseline, spacing: 8) { + if let status { + BlockTaskRow( + status: status, content: content, font: theme.body, line: line, onSetStatus: onSetStatus + ) + } else { + Text(marker) + .foregroundStyle(.secondary) + .monospacedDigit() + Text(AttributedString(norg: content, theme: theme)) + } + } + } +} -- cgit