text: import React from "react";
  import { Redirect } from "react-router";
  import { useParams, Link } from "react-router-dom";
  import SearchEvents from "./SearchEvents";
  
  const EventPageInCommunity = ({ newEventId, newEventFormWasSubmitted }) => {
    const { url } = useParams();
  
    return newEventFormWasSubmitted ? (
        <Redirect
          push
          to={{
            pathname: `/c/${url}/event/${newEventId}`,
          }}
        />
      ) : (
        <>
          <div className="pageTitle"><Link to="/all-events">All Events</Link>{` > Events in /c/${url}`}</div>
          <SearchEvents/>
        </>
      )
  };
  
  export default EventPageInCommunity;
  