import { Image,View, Button } from "@tarojs/components"
import style from './index.module.less'
import { handleShare } from '@/utils/share'
import { navToVip } from '@/utils/'
interface Props{
  show: boolean
  onClose: ()=> void
}
export default ({ show, onClose }:Props)=> {
  const nav2Vip = ()=> {
    if (process.env.TARO_ENV === 'h5') {
      handleShare()
    }
    navToVip();
  }
  if(show){
    return <>
      <View className={style.popupVip}>
        <View className={style.popupContent}>
          <View className={style.figureContainer}>
            <View className={`full-button-rounded relative ${style.viewButton}`} onClick={nav2Vip}>
              立即分享
                <Button openType={'share'} className="share-button"></Button>
              </View>
            <View className={`popup-close-button ${style.closeButton}`} onClick={onClose}></View>
            <Image className={style.figure} src="https://cdn.wehome.cn/cmn/png/203/META-H8UK2IWU-84SOFXOC8VMB65IKL5482-MOH2OE1M-S8.png" mode="widthFix"></Image>
          </View>
        </View>
      </View>
    </>
  }

  return <>
  </>
}
