// Copyright 2017-2020 @polkadot/app-address-book 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 BN from 'bn.js'; import React, { useState } from 'react'; import { Button, Input, InputNumber, Modal } from '@polkadot/react-components'; import { useTranslation } from '../translate'; export interface ModalProps { onClose: () => void; onRegister: (id: BN, name: string) => void; } interface Props extends ModalProps { className?: string; } function Create ({ onClose, onRegister }: Props): React.ReactElement { const { t } = useTranslation(); const [assetId, setAssetId] = useState(new BN(0)); const [name, setName] = useState('new asset'); const _onChangeAssetId = (assetId: BN | undefined): void => setAssetId(assetId || new BN(0)); const _onCommit = (): void => { onRegister(assetId, name); onClose(); }; return (