2024-05-05 19:31:28 +02:00
|
|
|
import AppIntents
|
2024-05-06 08:38:37 +02:00
|
|
|
import WidgetKit
|
2024-05-05 19:31:28 +02:00
|
|
|
|
|
|
|
struct HashtagPostsWidgetConfiguration: WidgetConfigurationIntent {
|
2024-06-26 11:05:35 +02:00
|
|
|
static let title: LocalizedStringResource = "Hashtag Widget Configuration"
|
2024-05-05 19:31:28 +02:00
|
|
|
static let description = IntentDescription("Choose the account and hashtag for this widget")
|
2024-05-06 08:38:37 +02:00
|
|
|
|
2024-05-05 19:31:28 +02:00
|
|
|
@Parameter(title: "Account")
|
2024-09-10 06:53:19 +02:00
|
|
|
var account: AppAccountEntity?
|
2024-05-06 08:38:37 +02:00
|
|
|
|
2024-05-05 19:31:28 +02:00
|
|
|
@Parameter(title: "Hashtag")
|
2024-09-10 06:53:19 +02:00
|
|
|
var hashgtag: String?
|
2024-05-05 19:31:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
extension HashtagPostsWidgetConfiguration {
|
|
|
|
static var previewAccount: HashtagPostsWidgetConfiguration {
|
|
|
|
let intent = HashtagPostsWidgetConfiguration()
|
|
|
|
intent.account = .init(account: .init(server: "Test", accountName: "Test account"))
|
|
|
|
intent.hashgtag = "Mastodon"
|
|
|
|
return intent
|
|
|
|
}
|
|
|
|
}
|