//
//  JustOneThingWidget.swift
//  JustOneThing
//
//  Created by Alan Francis on 11/06/2023.
//

import SwiftUI
import WidgetKit
import Intents

struct JustOneThingSystemWidget: Widget {
    let kind: String = "JustOneThingSystemWidget"
    let persistenceController = PersistenceController.shared

    var body: some WidgetConfiguration {
        IntentConfiguration(kind: kind,
                            intent: ConfigurationIntent.self,
                            provider: ThingProvider()) { entry in
            ThingView(thing: entry.thing)
        }
        .configurationDisplayName("Just One Thing")
        .description("Show a random Thing.")
        .supportedFamilies([.systemSmall, .systemMedium, .systemLarge])
    }
}
