- Auth: переключено на Pulse API (api.digital-home.site) вместо health - TabBar: Главная, Задачи, Привычки, Здоровье, Финансы - Models: TaskModels, HabitModels, FinanceModels, обновлённые AuthModels - Services: APIService (Pulse API), HealthAPIService (health отдельно) - Dashboard: обзор дня с задачами, привычками, readiness, балансом - Tasks: список, фильтр, создание, выполнение, удаление - Habits: список с прогресс-баром, отметка выполнения, стрики - Health: бывший DashboardView, HealthKit sync через health API key - Finance: баланс, список транзакций, добавление расхода/дохода - Health данные через x-api-key вместо JWT токена health сервиса
46 lines
1.6 KiB
Swift
46 lines
1.6 KiB
Swift
import SwiftUI
|
|
|
|
struct TaskRowView: View {
|
|
let task: PulseTask
|
|
let onComplete: () async -> Void
|
|
|
|
var priorityColor: Color {
|
|
switch task.priority {
|
|
case .urgent: return Color(hex: "ff0000")
|
|
case .high: return Color(hex: "ff4757")
|
|
case .medium: return Color(hex: "ffa502")
|
|
default: return Color(hex: "8888aa")
|
|
}
|
|
}
|
|
|
|
var body: some View {
|
|
HStack(spacing: 12) {
|
|
Button(action: { Task { await onComplete() } }) {
|
|
Image(systemName: task.done ? "checkmark.circle.fill" : "circle")
|
|
.font(.title3)
|
|
.foregroundColor(task.done ? Color(hex: "00d4aa") : Color(hex: "8888aa"))
|
|
}
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
Text(task.title)
|
|
.foregroundColor(task.done ? Color(hex: "8888aa") : .white)
|
|
.strikethrough(task.done)
|
|
.font(.callout)
|
|
if let desc = task.description, !desc.isEmpty {
|
|
Text(desc).font(.caption).foregroundColor(Color(hex: "8888aa")).lineLimit(1)
|
|
}
|
|
if let due = task.dueDate {
|
|
Text(due).font(.caption2).foregroundColor(Color(hex: "ffa502"))
|
|
}
|
|
}
|
|
Spacer()
|
|
if let priority = task.priority, priority != .low {
|
|
Circle().fill(priorityColor).frame(width: 8, height: 8)
|
|
}
|
|
}
|
|
.padding(12)
|
|
.background(RoundedRectangle(cornerRadius: 12).fill(Color.white.opacity(0.05)))
|
|
.padding(.horizontal)
|
|
.padding(.vertical, 2)
|
|
}
|
|
}
|