//
//  ViewController.swift
//  google_apps
//
//  Created by Dev Mac 1 on 27/03/2026.
//

import Cocoa
import SwiftUI

class ViewController: NSViewController {
    private var hostingView: NSHostingView<AnyView>?

    override func viewDidLoad() {
        super.viewDidLoad()
        let root = AnyView(
            LauncherRootView()
                .environmentObject(PremiumStore.shared)
        )
        let hostingView = NSHostingView(rootView: root)
        hostingView.translatesAutoresizingMaskIntoConstraints = false
        view.addSubview(hostingView)

        NSLayoutConstraint.activate([
            hostingView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
            hostingView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
            hostingView.topAnchor.constraint(equalTo: view.topAnchor),
            hostingView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
        ])

        self.hostingView = hostingView
    }

    override var representedObject: Any? {
        didSet {
            // Intentionally left blank.
        }
    }
}

