struct PreviewData: PreviewModifier {
   static func makeSharedContext() throws -> ModelContainer {
      let config = ModelConfiguration(isStoredInMemoryOnly: true)
      let container = try ModelContainer(for: Book.self, Author.self, configurations: config)

      let author = Author(name: "Stephen King", books: [])
      container.mainContext.insert(author)

      let book1 = Book(title: "Christine", author: author, cover: "book10", year: 1987)
      let book2 = Book(title: "IT", author: author, cover: "book11", year: 1986)
      container.mainContext.insert(book1)
      container.mainContext.insert(book2)

      return container
   }
   func body(content: Content, context: ModelContainer) -> some View {
      content.modelContainer(context)
   }
}