import { T9n } from 'features/T9n'

import {
  ScBody,
  Modal,
  ScText,
  ScWrapper,
} from './styled'

type Props = {
  error: string,
  handleModalClose: () => void,
  isModalOpen: boolean,
}

export const ErrorPopup = ({
  error,
  handleModalClose,
  isModalOpen,
}: Props) => (
  <Modal
    close={handleModalClose}
    isOpen={isModalOpen}
    withCloseButton
  >
    <ScWrapper>
      <ScBody>
        <ScText>
          <T9n t={error} />
        </ScText>
      </ScBody>
    </ScWrapper>
  </Modal>
)
