mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
* list of validators * validator details page * clean up * review fixes
31 lines
827 B
TypeScript
31 lines
827 B
TypeScript
import type { NextPage } from 'next';
|
|
import dynamic from 'next/dynamic';
|
|
import React from 'react';
|
|
|
|
import type { Props } from 'nextjs/getServerSideProps';
|
|
import PageNextJs from 'nextjs/PageNextJs';
|
|
|
|
import config from 'configs/app';
|
|
|
|
const validatorsFeature = config.features.validators;
|
|
|
|
const ValidatorDetails = dynamic(() => {
|
|
if (validatorsFeature.isEnabled && validatorsFeature.chainType === 'zilliqa') {
|
|
return import('ui/pages/ValidatorZilliqa');
|
|
}
|
|
|
|
throw new Error('Validators feature is not enabled.');
|
|
}, { ssr: false });
|
|
|
|
const Page: NextPage<Props> = (props) => {
|
|
return (
|
|
<PageNextJs pathname="/validators/[id]" query={ props.query }>
|
|
<ValidatorDetails/>
|
|
</PageNextJs>
|
|
);
|
|
};
|
|
|
|
export default Page;
|
|
|
|
export { validatorDetails as getServerSideProps } from 'nextjs/getServerSideProps';
|