// Copyright 2017-2020 @polkadot/app-staking authors & contributors // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. import React, { useCallback, useState } from 'react'; import { useParams } from 'react-router-dom'; import { Button, InputAddressSimple } from '@polkadot/react-components'; import { useTranslation } from '../translate'; import Validator from './Validator'; interface Props { className?: string; } function Query ({ className }: Props): React.ReactElement { const { t } = useTranslation(); const { value } = useParams(); const [validatorId, setValidatorId] = useState(value || null); const _onQuery = useCallback( (): void => { if (validatorId) { window.location.hash = `/staking/query/${validatorId}`; } }, [validatorId] ); return (
); } export default React.memo(Query);