//
//  InfoView.swift
//  Toolboxes
//
//  Created by 研发2组 on 2024/9/30.
//

import SwiftUI

struct InfoView: View {
    let imagename: String
    let title: String
    let value: String

    var body: some View {
        HStack(spacing: 15){
            Spacer().frame(width: 5.0)
            Image(imagename)
                .circularwhiteBackground(size: 50)
            VStack (alignment: .leading,spacing: 10){
                Text(title)
                    .font(.headline)
                    .foregroundColor(.black)
                    .lineLimit(1)
                Text(value)
                    .font(.callout)
                    .foregroundColor(.black)
                    .lineLimit(1)
            }
            Spacer()
        }
    }
}

struct InfoView_Previews: PreviewProvider {
    static var previews: some View {
        InfoView(imagename:"data_cb",title: L("Magnetic North"), value: String(format: "%.0f", 0.0))
    }
}
