import classNames from 'classnames'
import Taro from '@tarojs/taro'
import { Button } from '@tarojs/components'
import './style.scss'

export default (props) => {
  const { visible = false, Cancel = () => {} } = props

  const shareTimeline = () => {
    Taro.showToast({
      title: '请点击右上角分享到朋友圈',
      icon: 'none',
      duration: 3000,
    })
  }

  return (
    <view className={classNames('components', 'ShareModal', { show: visible })}>
      <view>
        <text>分享</text>
        <view>
          <view>
            <view onClick={shareTimeline}>
              <text className='iconfont icon-pengyouquan'></text>
              <text>朋友圈</text>
            </view>
            <Button openType='share'>
              <text className='iconfont icon-weixin'></text>
              <text>好友或群</text>
            </Button>
          </view>
          <text onClick={Cancel}>取消</text>
        </view>
      </view>
    </view>
  )
}
