76 lines
2.3 KiB
Swift
76 lines
2.3 KiB
Swift
//
|
|
// EmptyAlarmsView.swift
|
|
// TheNoiseClock
|
|
//
|
|
// Created by Matt Bruce on 9/7/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
import Bedrock
|
|
|
|
/// Empty state view for when no alarms are configured
|
|
struct EmptyAlarmsView: View {
|
|
|
|
// MARK: - Properties
|
|
let onAddAlarm: () -> Void
|
|
|
|
// MARK: - Body
|
|
var body: some View {
|
|
VStack(spacing: Design.Spacing.large) {
|
|
Spacer()
|
|
|
|
// Icon with subtle animation
|
|
ZStack {
|
|
Circle()
|
|
.fill(AppAccent.primary.opacity(0.1))
|
|
.frame(width: 100, height: 100)
|
|
|
|
Image(systemName: "alarm.fill")
|
|
.font(.system(size: 40))
|
|
.foregroundStyle(AppAccent.primary)
|
|
.symbolEffect(.bounce, value: true)
|
|
}
|
|
|
|
VStack(spacing: Design.Spacing.small) {
|
|
Text("No Alarms Set")
|
|
.typography(.title2Bold)
|
|
.foregroundStyle(AppTextColors.primary)
|
|
|
|
Text("Create an alarm to wake up gently on your own terms.")
|
|
.typography(.body)
|
|
.foregroundStyle(AppTextColors.secondary)
|
|
.multilineTextAlignment(.center)
|
|
.padding(.horizontal, Design.Spacing.xxLarge)
|
|
}
|
|
|
|
// Primary Action Button
|
|
Button(action: onAddAlarm) {
|
|
HStack {
|
|
Image(systemName: "plus.circle.fill")
|
|
.symbolEffect(.bounce, options: .nonRepeating)
|
|
Text("Add Your First Alarm")
|
|
}
|
|
.typography(.bodyEmphasis)
|
|
.foregroundStyle(.white)
|
|
.padding(.horizontal, Design.Spacing.large)
|
|
.padding(.vertical, Design.Spacing.medium)
|
|
.background(AppAccent.primary)
|
|
.clipShape(.rect(cornerRadius: Design.CornerRadius.medium))
|
|
.shadow(color: AppAccent.primary.opacity(0.3), radius: 8, x: 0, y: 4)
|
|
}
|
|
.padding(.top, Design.Spacing.medium)
|
|
|
|
Spacer()
|
|
}
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
.background(AppSurface.primary)
|
|
}
|
|
}
|
|
|
|
// MARK: - Preview
|
|
#Preview {
|
|
EmptyAlarmsView {
|
|
print("Add alarm tapped")
|
|
}
|
|
}
|