DFCoupleMiniCard.swift 1.38 KB
//
//  DFCoupleMiniCard.swift
//  hippo-watch-extension
//

import SwiftUI

struct DFCoupleMiniCard: View {
    let name: String
    let status: DFStressStatus
    let value: String
    let themeImage: Image?
    let title: String?

    init(
        name: String,
        status: DFStressStatus,
        value: String,
        themeImage: Image? = nil,
        title: String? = nil
    ) {
        self.name = name
        self.status = status
        self.value = value
        self.themeImage = themeImage
        self.title = title
    }

    var body: some View {
        HStack(spacing: 5) {
            DFStatusOrb(status: status, value: "", themeImage: themeImage)
                .frame(width: 30, height: 30)
            VStack(alignment: .leading, spacing: 1) {
                Text(title ?? status.title)
                    .font(.system(size: 10, weight: .semibold))
                    .foregroundStyle(status.color)
                    .lineLimit(1)
                    .minimumScaleFactor(0.7)
                Text(name)
                    .font(.system(size: 8, weight: .medium))
                    .foregroundStyle(.white)
                    .lineLimit(1)
                Text(value)
                    .font(.system(size: 8, weight: .regular))
                    .foregroundStyle(.white.opacity(0.78))
            }
        }
        .frame(maxWidth: .infinity, alignment: .leading)
    }
}