import { EditReportPage } from 'components/reports/ReportPage' ; import { NextPageContext } from 'next' ; import { ReactElement } from 'react' ; import renderPage from 'renderPage' ; import { Badge , Tag } from 'types' ; import { doBulkLookup } from 'utils' ; type CreateReportPageProps = { nameToCode : { [ cat ] : { [ key ] : string ; } ; } ; authenticated : boolean | null ; badges : Badge [ ] ; tags : Tag [ ] ; } ; const CreateReportPage = ( props ) : ReactElement => { return < EditReportPage { ... props } report = { null } / > ; } ; CreateReportPage . getInitialProps = async ( ctx ) => { return await doBulkLookup ( [ [ 'nameToCode' , '/clubs/fields/?format=json' ] , [ 'badges' , '/badges/?format=json' ] , [ 'tags' , '/tags/?format=json' ] , ] , ctx ) ; } ; CreateReportPage . permissions = [ 'clubs.generate_reports' ] ; export default renderPage ( CreateReportPage ) ;