//
//  SQSearchBarButton.swift
//  AlloVoisinsSwiftUI
//
//  Created by Victor on 08/01/2025.
//

import SwiftUI

struct SQSearchBarButton: View {
    var placeholder: String
    var action: () -> Void = {}

    var body: some View {
        HStack(spacing: 16) {
            SQIcon(.magnifying_glass, type: .solid)
            SQText(placeholder)
                .sqColor(.sqNeutral(50))
        }
        .frame(maxWidth: .infinity, alignment: .leading)
        .padding()
        .background(Color.sqNeutral(10))
        .cornerRadius(8)
        .onTapGesture {
            action()
        }
    }
}

#Preview {
    SQSearchBarButton(placeholder: "Rechercher") {
        print("search")
    }
}
