// components/forms/SearchForm.js
<button
  onClick={() => setSearch({ ...search, action: "Buy", price: "" })}
  className="col-lg-2 btn btn-primary"
>
  {search.action === "Buy" ? "✅ Buy" : "Buy"}
</button>
<button
  onClick={() => setSearch({ ...search, action: "Rent", price: "" })}
  className="col-lg-2 btn btn-primary"
>
  {search.action === "Rent" ? "✅ Rent" : "Rent"}
</button>
<button
  onClick={() => setSearch({ ...search, type: "House" })}
  className="col-lg-2 btn btn-primary"
>
  {search.type === "House" ? "✅ House" : "House"}
</button>
<button
  onClick={() => setSearch({ ...search, type: "Land" })}
  className="col-lg-2 btn btn-primary"
>
  {search.type === "Land" ? "✅ Land" : "Land"}
</button>

Now on button click, execute a function

<button onClick={handleSearch} className="col-lg-2 btn btn-danger">
  Search
</button>

  const handleSearch = async () => {
    try {
      console.log(search);
    } catch (err) {
      console.log(err);
    }
  };