import React, { useContext } from 'react'; import PropTypes from 'prop-types'; import { I18nContext } from '../../../../.storybook/i18n'; import { Box, ButtonLink, Text } from '../../component-library'; import { AlignItems, BorderRadius, Display, JustifyContent, Size, TextVariant, } from '../../../helpers/constants/design-system'; export default function CustomNonce({ nextNonce, customNonceValue, showCustomizeNonceModal, }) { const t = useContext(I18nContext); return ( {t('nonce')} showCustomizeNonceModal()} > {t('edit')} {customNonceValue || nextNonce} ); } CustomNonce.propTypes = { /** * Getting the next suggested nonce */ nextNonce: PropTypes.number, /** * Custom nonce value */ customNonceValue: PropTypes.string, /** * Function that is supposed to open the customized nonce modal */ showCustomizeNonceModal: PropTypes.func, };