import UserGalleryPage from 'scenes/UserGalleryPage/UserGalleryPage' ; import GalleryRoute from 'scenes/_Router/GalleryRoute' ; import { GetServerSideProps } from 'next' ; import GalleryRedirect from 'scenes/_Router/GalleryRedirect' ; type UserGalleryProps = { username ? : string ; } ; export default function UserGallery ( { username } ) { if ( ! username ) { return < GalleryRedirect to = "/" / > ; } return < GalleryRoute element = { < UserGalleryPage username = { username } />}/ > ; } export const getServerSideProps = async ( { params } ) => ( { props : { username : params ?. username ? ( params . username as string ) : undefined , } , } ) ;