From 364998dc956df1ecbb2da997a9abe1c130e8a865 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Mon, 23 Sep 2024 22:02:36 -0300 Subject: [PATCH] fix: search --- src/components/events/Events.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/events/Events.tsx b/src/components/events/Events.tsx index c61aa96..42e07b7 100644 --- a/src/components/events/Events.tsx +++ b/src/components/events/Events.tsx @@ -4,14 +4,12 @@ import React from "react"; import EventCard from "./EventCard"; import {Event} from "@/models"; import Loading from "@/app/auth/email/confirmation/[token]/loading"; -import {useRouter} from "next/navigation"; import Link from "next/link"; import {downloadThumbnail, searchEvents} from "@/server-actions/event.action"; const Events = ({max, search, all = false}: { max?: number, search?: string, all?: boolean }) => { const [events, setEvents] = React.useState([]); const [loading, setLoading] = React.useState(true); - const router = useRouter(); React.useEffect(() => { const fetchEvents = async () => { @@ -32,7 +30,7 @@ const Events = ({max, search, all = false}: { max?: number, search?: string, all setLoading(false); }; fetchEvents(); - }, [router]); + }, [search]); if (loading) return ;