import React from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; import Chip from '../../../components/ui/chip'; import Box from '../../../components/ui/box'; import Typography from '../../../components/ui/typography'; import { ChipWithInput } from '../../../components/ui/chip/chip-with-input'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { TYPOGRAPHY, COLORS, BORDER_STYLE, SIZES, DISPLAY, } from '../../../helpers/constants/design-system'; export default function RecoveryPhraseChips({ secretRecoveryPhrase, phraseRevealed, confirmPhase, setInputValue, inputValue, indicesToCheck, }) { const t = useI18nContext(); const hideSeedPhrase = phraseRevealed === false; return (
{secretRecoveryPhrase.map((word, index) => { if ( confirmPhase && indicesToCheck && indicesToCheck.includes(index) ) { return (
{`${index + 1}.`}
{ setInputValue({ ...inputValue, [index]: value }); }} />
); } return (
{`${index + 1}.`}
{word}
); })}
{hideSeedPhrase && (
{t('makeSureNoOneWatching')}
)}
); } RecoveryPhraseChips.propTypes = { secretRecoveryPhrase: PropTypes.array, phraseRevealed: PropTypes.bool, confirmPhase: PropTypes.bool, setInputValue: PropTypes.func, inputValue: PropTypes.string, indicesToCheck: PropTypes.array, };