import SwiftUI
import SwiftData

@main
struct SesameApp: App {
    
    @State
    var modelContainer: ModelContainer
    
    init() {
        do {
            self.modelContainer = try ModelContainer(for: HistoryItem.self)
        } catch {
            fatalError("Failed to create model container: \(error)")
        }
    }
    
    var body: some Scene {
        WindowGroup {
            ContentView(modelContext: modelContainer.mainContext)
        }
        .modelContainer(modelContainer)
    }
}
