mirror of
https://github.com/we-promise/sure.git
synced 2026-09-06 15:14:19 +00:00
* Add Swift-native Sure app * Fix push subscriptions schema for CI * Address native app review feedback * Address remaining native app review feedback * Use Flutter app logo for native icon * Honor insight notification preferences and locale --------- Co-authored-by: Juan Jose Mata <2v8shcb6pz@privaterelay.appleid.com> Co-authored-by: sure-admin <sure-admin@splashblot.com>
53 lines
1.7 KiB
Swift
53 lines
1.7 KiB
Swift
import SwiftUI
|
||
|
||
struct SureBudgetsView: View {
|
||
@Environment(SureStore.self) private var store
|
||
|
||
var body: some View {
|
||
NavigationStack {
|
||
ScrollView {
|
||
LazyVStack(spacing: 14) {
|
||
ForEach(store.budgets) { budget in
|
||
VStack(alignment: .leading, spacing: 12) {
|
||
HStack {
|
||
VStack(alignment: .leading, spacing: 3) {
|
||
Text(budget.name)
|
||
.font(.headline)
|
||
Text("\(budget.startDate) – \(budget.endDate)")
|
||
.font(.caption)
|
||
.foregroundStyle(.secondary)
|
||
}
|
||
Spacer()
|
||
if budget.current {
|
||
Text("CURRENT")
|
||
.font(.caption2.bold())
|
||
.foregroundStyle(Color.sureMint)
|
||
}
|
||
}
|
||
Divider()
|
||
LabeledContent("Allocated", value: budget.allocatedSpending)
|
||
if let planned = budget.budgetedSpending {
|
||
LabeledContent("Planned", value: planned)
|
||
}
|
||
}
|
||
.padding(18)
|
||
.background(.background.secondary, in: .rect(cornerRadius: 18))
|
||
.accessibilityElement(children: .combine)
|
||
}
|
||
if store.budgets.isEmpty && !store.isLoading {
|
||
ContentUnavailableView(
|
||
"No budgets yet",
|
||
systemImage: "chart.pie",
|
||
description: Text("Create a budget in Sure to track it here.")
|
||
)
|
||
}
|
||
}
|
||
.frame(maxWidth: .infinity)
|
||
.padding()
|
||
}
|
||
.refreshable { await store.refreshAll() }
|
||
.navigationTitle("Budgets")
|
||
}
|
||
}
|
||
}
|