//
//  IntroView.swift
//  AcaMate
//
//  Created by Sean Kim on 12/1/24.
//

import SwiftUI
import Combine


struct IntroView: View {
    @EnvironmentObject var appVM: AppViewModel
    @StateObject var introVM: IntroViewModel
    @State var cancellables: Set<AnyCancellable> = []
    
    init(_ appVM: AppViewModel) {
        _introVM = StateObject(wrappedValue: IntroViewModel(appVM))
    }
    
    var body: some View {
        VStack(spacing: 0) {
            Spacer()
                .frame(height: 100)
            Image(.Logo.crystalIcon)
                .resizable()
                .frame(width: 200, height: 200)
            Spacer()
            HStack(spacing: 4) {
                Image(.Logo.teamIcon)
                    .resizable()
                    .frame(width: 24, height: 24)
                Text("STEIN")
                    .font(.nps(font: .bold, size: 16))
                    .foregroundStyle(Color(.Text.detail))
            }
            .padding(.bottom,12)
            Text("Copyright © Team.Stein")
                .font(.nps(font: .regular, size: 14))
                .foregroundStyle(Color(.Text.detail))
                .padding(.bottom,50)
        }
        
        .onAppear {
            printLog("IntroView_onAppear")
            introVM.appStart()
        }
    }
}
