"use client" import { Search } from "lucide-react" import { useRouter } from "next/navigation" import { Input } from "../../ui/input" export default function DashboardNavbarSearch() { // const [search, setSearch] = useState(""); const router = useRouter() // useEffect(() => { // const delayDebounceFn = setTimeout(() => { // if (search) { // router.push(`/dashboard?q=${search}`); // } else { // router.push(`/dashboard`); // } // }, 300); // return () => clearTimeout(delayDebounceFn); // }, [search]); return (
setSearch(e.target.value)} onChange={(e) => { if (e.target.value === "") { router.push(`/dashboard`) return } router.push(`/dashboard?q=${e.target.value}`) }} placeholder="Search projects..." className="pl-8" />
) }