//
//  AppInfoView.swift
//  AcaMate
//
//  Created by TAnine on 2/13/25.
//

import SwiftUI

struct AppInfoView: View {
    @UserDefault(key:"currentVer", defaultValue: "0.0.0") var currentVer
    @UserDefault(key:"finalVer", defaultValue: "0.0.0") var finalVer
    
    var body: some View {
        EtcBoxView(title: "앱 정보"){
            HStack(spacing: 0) {
                Image(.Logo.pageIcon)
                    .resizable()
                    .frame(width: 40, height: 40, alignment: .center)
                    .padding(.trailing, 12)
                Text("설치 버전: \(currentVer)")
                    .font(.nps(font: .bold, size: 16))
                    .foregroundStyle(Color(.Text.detail))
                Spacer(minLength: 1)
                if currentVer == finalVer {
                    Text("최신버전입니다.")
                        .font(.nps(size: 12))
                        .foregroundStyle(Color(.Normal.light))
                }
            }
            .padding([.top,.bottom],12)
        }
    }
}
