summaryrefslogtreecommitdiffstats
path: root/Solsnu.Widget/Solsnu_WidgetBundle.swift
blob: 7bd3f1ab926585d8998e510cc2349960a5d4d19f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
//  Solsnu_WidgetBundle.swift
//  Solsnu.Widget
//
//  Created by Ivar Løvlie on 15/12/2025.
//

import WidgetKit
import SwiftUI

@main
struct Solsnu_WidgetBundle: WidgetBundle {
    var body: some Widget {
        Solsnu_Widget()
        Solsnu_WidgetMedium()
    }
}

struct Solsnu_WidgetMedium: Widget {
    let kind: String = "Solsnu_Widget_Medium"

    var body: some WidgetConfiguration {
        StaticConfiguration(kind: kind, provider: Provider()) { entry in
            if #available(iOS 17.0, *) {
                MediumWidgetView(entry: entry)
                    .containerBackground(.fill.tertiary, for: .widget)
            } else {
                MediumWidgetView(entry: entry)
                    .padding()
                    .background()
            }
        }
        .configurationDisplayName("Solstice Countdown")
        .description("Days until next solstice or equinox")
        .supportedFamilies([.systemMedium,.systemSmall])
    }
}