-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTodoItemRow.swift
More file actions
54 lines (50 loc) · 1.63 KB
/
TodoItemRow.swift
File metadata and controls
54 lines (50 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// TodoItemRow.swift
// DevLog
//
// Created by 최윤진 on 2/21/26.
//
import SwiftUI
struct TodoItemRow: View {
private let item: TodoListItem
init(_ item: TodoListItem) {
self.item = item
}
var body: some View {
HStack {
VStack(alignment: .leading, spacing: 5) {
HStack {
if item.isPinned {
Image(systemName: "star.fill")
.font(.headline)
.foregroundStyle(.orange)
}
if item.isCompleted {
Image(systemName: "checkmark.circle.fill")
.font(.headline)
.foregroundStyle(.green)
}
Text(item.title)
.font(.headline)
.foregroundStyle(Color(.label))
.lineLimit(1)
if let number = item.number {
Text("#\(number)")
.font(.subheadline.weight(.semibold))
.foregroundStyle(.gray)
.fixedSize(horizontal: true, vertical: false)
}
}
RelativeTimeText(date: item.updatedAt)
if !item.tags.isEmpty {
TagList(item.tags, lineLimit: 1)
}
}
Spacer()
Image(systemName: "chevron.right")
.font(.caption2.bold())
.foregroundStyle(.gray)
}
.padding(.vertical, 8)
}
}