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

import SwiftUI

struct CountdownDialView: View {

    @EnvironmentObject var conductor: Conductor
    
    @ObservedObject var countdown: Countdown
    
    var body: some View {
        
        HStack {
            VStack(alignment: .leading) {
                Text(countdown.activity?.name?.uppercased() ?? "").multilineTextAlignment(.leading)
                Text(countdown.duration.minuteSecond)
            }
            Spacer()
        }
    }
    
}

struct CountdownLiveView_Previews: PreviewProvider {
    static var previews: some View {
        CountdownDialView(countdown: Countdown.fake(context: PersistenceController.preview.container.viewContext)).background(.cyan).environmentObject(Conductor.maestro)
    }
}
