import SwiftUI struct TodayView: View { @EnvironmentObject private var store: WatchWeekStore private var today: WatchWeekPayload.Day? { store.payload?.days.first(where: \.isToday) } var body: some View { ScrollView { VStack(alignment: .leading, spacing: 8) { if let today { Text(today.title) .font(.headline) .foregroundStyle(Color(red: 1.0, green: 0.45, blue: 0.35)) ForEach(Array(today.meals.enumerated()), id: \.offset) { _, meal in VStack(alignment: .leading, spacing: 2) { Label(meal.label, systemImage: WatchWeekPayload.icon(for: meal.type)) .font(.caption2) .foregroundStyle(.secondary) Text(meal.name ?? "—") .font(.body.weight(.medium)) .lineLimit(2) } .frame(maxWidth: .infinity, alignment: .leading) .padding(8) .background(.quaternary.opacity(0.5), in: RoundedRectangle(cornerRadius: 8)) } } else { EmptySyncView() } } } .navigationTitle("MealMood") } } struct EmptySyncView: View { var body: some View { VStack(spacing: 8) { Image(systemName: "iphone.and.arrow.forward") .font(.title3) .foregroundStyle(.secondary) // The payload arrives fully localized from the iPhone; the watch // bundle carries no strings of its own, so this stays neutral. Text(verbatim: "MealMood") .font(.caption2) .foregroundStyle(.secondary) } .padding(.top, 20) } }