//
//  TitleView.swift
//  Werkout_ios
//
//  Created by Trey Tartt on 6/17/24.
//

import SwiftUI

struct TitleView: View {
    @ObservedObject var bridgeModule = BridgeModule.shared
    
    var body: some View {
        HStack {
            if let workout = bridgeModule.currentExerciseInfo.workout {
                Text(workout.name)
                    .font(Font.system(size: 100))
                    .frame(maxWidth: .infinity, alignment: .leading)
            }
            
            if bridgeModule.currentWorkoutRunTimeInSeconds > -1 {
                Text("\(bridgeModule.currentWorkoutRunTimeInSeconds)")
                    .font(Font.system(size: 100))
                    .frame(maxWidth: .infinity, alignment: .trailing)
                    .padding(.trailing, 100)
            }
        }
    }
}

#Preview {
    TitleView()
}
