Skip to content

Commit

Permalink
fix: search
Browse files Browse the repository at this point in the history
  • Loading branch information
oproprioleonardo committed Sep 24, 2024
1 parent 4a693fd commit 364998d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/events/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<Event[]>([]);
const [loading, setLoading] = React.useState(true);
const router = useRouter();

React.useEffect(() => {
const fetchEvents = async () => {
Expand All @@ -32,7 +30,7 @@ const Events = ({max, search, all = false}: { max?: number, search?: string, all
setLoading(false);
};
fetchEvents();
}, [router]);
}, [search]);

if (loading) return <Loading/>;

Expand Down

0 comments on commit 364998d

Please sign in to comment.