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 { TypographyVariant, BorderStyle, Size, DISPLAY, BorderColor, Color, } from '../../../helpers/constants/design-system'; export default function RecoveryPhraseChips({ secretRecoveryPhrase, phraseRevealed, confirmPhase, setInputValue, inputValue, indicesToCheck, hiddenPhrase, }) { 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 && (
{!hiddenPhrase && ( <> {t('makeSureNoOneWatching')} )}
)}
); } RecoveryPhraseChips.propTypes = { secretRecoveryPhrase: PropTypes.array, phraseRevealed: PropTypes.bool, confirmPhase: PropTypes.bool, setInputValue: PropTypes.func, inputValue: PropTypes.object, indicesToCheck: PropTypes.array, hiddenPhrase: PropTypes.bool, };