import { Text, View } from '@tarojs/components'
import { PublishBottomSheet, PublishIcon } from '@/features/publish/components/PublishPrimitives'
import './index.scss'

interface SuccessModalProps {
  visible: boolean
  onStay: () => void
  onGoPlaza: () => void
}

export function SuccessModal({ visible, onStay, onGoPlaza }: SuccessModalProps) {
  return (
    <PublishBottomSheet visible={visible} centered>
      <View className='publish-success-modal'>
        <View className='publish-success-modal__check'>
          <PublishIcon name='check' size={32} />
        </View>
        <Text className='publish-success-modal__title'>发布成功</Text>
        <Text className='publish-success-modal__desc'>你的动态已发布到广场,正在通知关注你的人</Text>
        <View className='publish-success-modal__actions'>
          <View className='publish-success-modal__btn publish-success-modal__btn--secondary' onClick={onStay}>
            留在发布
          </View>
          <View className='publish-success-modal__btn publish-success-modal__btn--primary' onClick={onGoPlaza}>
            查看动态
          </View>
        </View>
      </View>
    </PublishBottomSheet>
  )
}

export default SuccessModal
