import SwiftUI

@main
struct FlightsApp: App {
    let database: AirportDatabase
    let loadService: AirlineLoadService
    let routeExplorer = RouteExplorerClient()
    let openSky = OpenSkyClient()

    init() {
        let db = AirportDatabase()
        self.database = db
        self.loadService = AirlineLoadService(airportDatabase: db)
    }

    var body: some Scene {
        WindowGroup {
            RootView(
                database: database,
                loadService: loadService,
                routeExplorer: routeExplorer,
                openSky: openSky
            )
        }
    }
}
