import React, { useCallback, useState } from 'react'
import styles from './index.module.scss'
import TopCom from '@/components/TopCom'

import topImg from '@/assets/img/team/top.png'
import history from '@/utils/history'
import ZinfoPop from '@/components/ZinfoPop'

function A7team() {
  const toFromFu = useCallback((can: '1' | '2') => {
    // history.push(`/proof/${can}`)
    setTitPop({
      txt1: can === '1' ? '您已完成认证' : '申请审核中',
      txt2: can === '1' ? '无需重复申请' : '请勿重复申请'
    })
  }, [])

  // 打开提示弹窗
  const [titPop, setTitPop] = useState({
    txt1: '',
    txt2: ''
  })

  return (
    <div className={styles.A7team}>
      <TopCom txt='选择团体' />
      <div className='A7main'>
        <img src={topImg} alt='' />
        <div className='A7tit'>请选择认证单位</div>

        <div className='A7dan1' onClick={() => toFromFu('1')}>
          <div>横琴粤澳深度合作区民生事务局</div>
        </div>
        <div className='A7dan1' onClick={() => toFromFu('2')}>
          <div className='A7dan1_1'>澳门街坊会联合总会广东办事处</div>
        </div>
      </div>
      {/* 提示的弹窗 */}
      {titPop.txt1 ? (
        <ZinfoPop
          txt1={titPop.txt1}
          txt2={titPop.txt2}
          type='info'
          callFu={() => setTitPop({ txt1: '', txt2: '' })}
        />
      ) : null}
    </div>
  )
}

const MemoA7team = React.memo(A7team)

export default MemoA7team
