| 12345678910111213141516171819202122232425262728293031323334 |
- //
- // LiveActivityCOBLabelView.swift
- // Trio
- //
- // Created by Cengiz Deniz on 17.10.24.
- //
- import Foundation
- import SwiftUI
- import WidgetKit
- struct LiveActivityCOBLabelView: View {
- var context: ActivityViewContext<LiveActivityAttributes>
- var additionalState: LiveActivityAttributes.ContentAdditionalState
- var body: some View {
- VStack(spacing: 2) {
- HStack {
- Text(
- "\(additionalState.cob)"
- ).fontWeight(.bold)
- .font(.title3)
- .foregroundStyle(context.isStale ? .secondary : .primary)
- .strikethrough(context.isStale, pattern: .solid, color: .red.opacity(0.6))
- Text(String(localized: "g", comment: "gram of carbs"))
- .font(.headline).fontWeight(.bold)
- .foregroundStyle(context.isStale ? .secondary : .primary)
- .strikethrough(context.isStale, pattern: .solid, color: .red.opacity(0.6))
- }
- Text("COB").font(.subheadline).foregroundStyle(.primary)
- }
- }
- }
|