import React from 'react'; import { useMemo } from 'react'; import { useLocation, Navigate, Outlet } from 'react-router-dom'; import { useAppSelector } from '../hooks'; import { selectGuests } from '../slices/auth/adminSlice'; const authenticate = () => { const guests = useAppSelector(selectGuests); return useMemo(() => ({ guests }), [guests]); }; function Rsvp() { const auth = authenticate(); const location = useLocation(); return auth?.guests ? ( ) : ( ); } export default Rsvp;