import { T9n } from 'features/T9n'
import { Header, HeaderTitle } from 'features/PopupComponents'

import {
  Wrapper,
  Body,
  Footer,
  ResultText,
  SmallButton,
} from '../../styled'
import { useBuyMatchPopupStore } from '../../store'

export const ErrorStep = () => {
  const {
    close,
    error: paymentError,
  } = useBuyMatchPopupStore()

  return (
    <Wrapper width={369}>
      <Header height={24}>
        <HeaderTitle>
          <T9n t='payment' />
        </HeaderTitle>
      </Header>
      <Body marginTop={30}>
        <ResultText>
          {paymentError || <T9n t='error_payment_unsuccessful' />}
        </ResultText>
      </Body>
      <Footer>
        <SmallButton onClick={close}>
          Ок
        </SmallButton>
      </Footer>
    </Wrapper>
  )
}
