import Foundation
import SwiftData

extension RitualStore {
    static var preview: RitualStore {
        let schema = Schema([Ritual.self, RitualArc.self, ArcHabit.self])
        let configuration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: true)
        let container: ModelContainer
        do {
            container = try ModelContainer(for: schema, configurations: [configuration])
        } catch {
            fatalError("Preview container failed: \(error)")
        }
        return RitualStore(modelContext: container.mainContext, seedService: RitualSeedService(), settingsStore: SettingsStore())
    }
}
