Files
tom goriunovandGitHub 797b8f57bb Validators list (#1621)
* new ENV and page placeholder

* display list data

* comment out SearchInput

* add counters

* add tag to address page

* tests

* refactoring

* fix ts

* change ENVs for demo

* fix ENVs validator

* [skip ci] remove hash

* review fixes
2024-02-19 11:04:28 +04:00

30 lines
781 B
TypeScript

import type { Feature } from './types';
import { VALIDATORS_CHAIN_TYPE } from 'types/client/validators';
import type { ValidatorsChainType } from 'types/client/validators';
import { getEnvValue } from '../utils';
const chainType = ((): ValidatorsChainType | undefined => {
const envValue = getEnvValue('NEXT_PUBLIC_VALIDATORS_CHAIN_TYPE') as ValidatorsChainType | undefined;
return envValue && VALIDATORS_CHAIN_TYPE.includes(envValue) ? envValue : undefined;
})();
const title = 'Validators list';
const config: Feature<{ chainType: ValidatorsChainType }> = (() => {
if (chainType) {
return Object.freeze({
title,
isEnabled: true,
chainType,
});
}
return Object.freeze({
title,
isEnabled: false,
});
})();
export default config;