Skip to content

Instantly share code, notes, and snippets.

View Gyane-git's full-sized avatar

Gyanendra Kumar Sah Gyane-git

View GitHub Profile
"use client";
import React, { useState, useEffect, useRef } from "react";
import { Search, X } from "lucide-react";
import { useRouter, usePathname } from "next/navigation";
import { apiRequest } from "@/utils/ApiSafeCalls";
export default function SearchBar() {
const [searchTerm, setSearchTerm] = useState("");
const [suggestions, setSuggestions] = useState([]);
const [loading, setLoading] = useState(false);