//
//  EmptyView.swift
//  Feels (iOS)
//
//  Created by Trey Tartt on 2/10/22.
//

import SwiftUI

struct EmptyHomeView: View {
    @AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
    @AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor

    let viewModel: DayViewViewModel
    
    var body: some View {
        ZStack {
            theme.currentTheme.secondaryBGColor
            
            VStack {
                AddMoodHeaderView(addItemHeaderClosure: { (mood, date) in
                    withAnimation {
                        viewModel.add(mood: mood, forDate: date, entryType: .header)
                    }
                })
            }
        }
        .fixedSize(horizontal: false, vertical: true)
        .cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
    }
}

struct EmptyHomeView_Previews: PreviewProvider {
    static var previews: some View {
        EmptyHomeView(viewModel: DayViewViewModel(addMonthStartWeekdayPadding: false))
    }
}
