import SwiftUI

struct SecondaryButton: View {
    let title: String
    var icon: String? = nil
    let action: () -> Void
    var localizeTitle: Bool = true

    var body: some View {
        Button(action: action) {
            HStack(spacing: 8) {
                Group {
                    if localizeTitle {
                        Text(LocalizedStringKey(title))
                    } else {
                        Text(verbatim: title)
                    }
                }
                .font(.mealMoodBodyBold)
                if let icon = icon {
                    Text(icon)
                }
            }
            .foregroundColor(.mealMoodTextPrimary)
            .padding(.horizontal, 24)
            .padding(.vertical, 14)
            .frame(maxWidth: .infinity)
            .background(Color.mealMoodSurface)
            .overlay(
                RoundedRectangle(cornerRadius: 14)
                    .stroke(Color.mealMoodTextSecondary.opacity(0.3), lineWidth: 1.5)
            )
            .cornerRadius(14)
        }
    }
}
