import SwiftUI

struct PrimaryButtonStyle: ButtonStyle {
    @Environment(\.isEnabled) private var isEnabled

    func makeBody(configuration: Configuration) -> some View {
        configuration
            .label
            .font(.system(size: 20, weight: .semibold, design: .rounded))
            .padding(20)
            .frame(height: 40)
            .frame(maxWidth: .infinity)
            .foregroundColor(.Main.white)
            .background {
                RoundedRectangle(cornerRadius: 4.0)
                    .foregroundColor(isEnabled ? .Tango.orangeMedium : .Main.separator)
            }
            .contentShape(Rectangle())
            .scaleEffect(configuration.isPressed ? 0.9 : 1.0)
            .opacity(configuration.isPressed ? 0.6 : 1.0)
            .animation(.easeInOut, value: configuration.isPressed)
    }
}

struct SecondaryButtonStyle: ButtonStyle {
    @Environment(\.isEnabled) private var isEnabled

    func makeBody(configuration: Configuration) -> some View {
        configuration
            .label
            .font(.system(size: 20, weight: .semibold, design: .rounded))
            .padding(20)
            .frame(height: 40)
            .frame(maxWidth: .infinity)
            .foregroundColor(isEnabled ? .Tango.orangeMedium : .Main.separator)
            .background {
                RoundedRectangle(cornerRadius: 4.0)
                    .stroke(isEnabled ? Color.Tango.orangeMedium : Color.Main.separator)
            }
            .contentShape(Rectangle())
            .scaleEffect(configuration.isPressed ? 0.9 : 1.0)
            .opacity(configuration.isPressed ? 0.6 : 1.0)
            .animation(.easeInOut, value: configuration.isPressed)
    }
}
