2023-08-09 08:55:27 +00:00
|
|
|
import { usePathname, useSearchParams } from "next/navigation";
|
|
|
|
|
|
|
|
export default function useIsBookingPage() {
|
|
|
|
const pathname = usePathname();
|
2023-08-09 22:54:51 +00:00
|
|
|
const isBookingPage = ["/booking/", "/cancel", "/reschedule"].some((route) => pathname?.startsWith(route));
|
2023-08-09 08:55:27 +00:00
|
|
|
|
|
|
|
const searchParams = useSearchParams();
|
|
|
|
const userParam = searchParams.get("user");
|
|
|
|
const teamParam = searchParams.get("team");
|
|
|
|
|
|
|
|
return !!(isBookingPage || userParam || teamParam);
|
|
|
|
}
|