//
//  AlarmDialView.swift
//  LeCountdown
//
//  Created by Laurent Morvillier on 01/02/2023.
//

import SwiftUI

struct AlarmDialView: View {
    
    @ObservedObject var alarm: Alarm
    
    var body: some View {
        
        HStack {
            
            VStack {
                Text(alarm.activity?.name?.uppercased() ?? "")
                if let fireDate = alarm.fireDate {
                    Text(fireDate, style: .time)
                }
                Spacer()
            }
            Spacer()
        }
    }
    
}

struct AlarmDialView_Previews: PreviewProvider {
    static var previews: some View {
        AlarmDialView(alarm: Alarm.fake(context: PersistenceController.preview.container.viewContext))
            .background(.cyan)
    }
}
