// Copyright 2017-2021 @polkadot/app-democracy authors & contributors // SPDX-License-Identifier: Apache-2.0 import type { Hash } from '@polkadot/types/interfaces'; import React from 'react'; import { Button } from '@polkadot/react-components'; import { useToggle } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; import PreImage from './PreImage'; interface Props { imageHash: Hash; isImminent?: boolean; } function PreImageButton ({ imageHash, isImminent }: Props): React.ReactElement | null { const { t } = useTranslation(); const [isPreimageOpen, togglePreimage] = useToggle(); return ( <>