import useIsAuthenticated from 'contexts/auth/useIsAuthenticated' ; import GalleryRedirect from './GalleryRedirect' ; import Route , { GalleryRouteProps } from './GalleryRoute' ; export default function GalleryAuthenticatedRoute ( props ) { const isAuthenticated = useIsAuthenticated ( ) ; if ( ! isAuthenticated ) { return < GalleryRedirect to = "/" / > ; } return < Route { ... props } / > ; }