// Copyright 2017-2020 @polkadot/react-signer 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 { FunctionMetadataLatest } from '@polkadot/types/interfaces'; import { QueueTx } from '@polkadot/react-components/Status/types'; import BN from 'bn.js'; import React from 'react'; import styled from 'styled-components'; import { registry } from '@polkadot/react-api'; import { Call, InputAddress, Modal } from '@polkadot/react-components'; import Checks from './Checks'; import { useTranslation } from './translate'; interface Props { children?: React.ReactNode; className?: string; hideDetails?: boolean; isSendable: boolean; onError: () => void; tip?: BN; value: QueueTx; } function formatMeta (meta?: FunctionMetadataLatest): React.ReactNode | null { if (!meta) { return null; } const strings = meta.documentation.map((doc): string => doc.toString().trim()); const firstEmpty = strings.findIndex((doc): boolean => !doc.length); if (!firstEmpty) { return null; } return (