import SwiftUI

struct TaskTitleView: View {
    @ObservedObject var taskViewModel: TaskViewModel
    var title: String = "Menu"
    var viewMode: TaskViewMode? = nil

    var body: some View {
        HStack {
            Button(action: {
                if let mode = viewMode {
                    taskViewModel.viewMode = mode
                }
            }, label: {
                if viewMode != nil {
                    Image("ink_02")
                }
            })
            .disabled(viewMode == nil)
            .frame(width: 48, height: 48)

            Spacer()
            HStack(spacing: 0) {
                Text(title)
                    .font(FontStyle.TitleL.font)
                    .foregroundColor(ColorSet.Body.color)
            }

            Spacer()

            Button(action: {
                print(debug: "called")
            }, label: {
            })
            .frame(width: 48, height: 48)
        }
        .frame(height: LayoutConstants.menuTitleHeight)

        Divider()
            .background(ColorSet.LineColor03.color)
    }
}

#Preview {
    MenuMainView(taskViewModel: TaskViewModel())
}
