import { Text, View } from '@tarojs/components'
import { memo } from 'react'
import classnames from 'classnames'
import styles from './index.module.scss'
import { REFUND_STATUS_ORDER } from '@/common/enum'

interface Param {
  status?: number
}
const OrderStatusTag = ({ status = 0 }: Param) => {
  const {
    ReturnApplyOrderTypeAdvanceReceiptRefund, // 预收退款
    ReturnApplyOrderTypeReturnForRefund, // 退货退款
    ReturnApplyOrderTypeSalesRefund, // 销售退款
  } = REFUND_STATUS_ORDER
  return (
    <>
      {(status !== 0) && <View className={classnames(styles.tag, status != ReturnApplyOrderTypeReturnForRefund.value ? styles.refund_tag : styles.saleReturn_tag)}>
        <View className={classnames(styles.miconfont, 'iconfont icon-yucunkuan')}></View>
        <Text>{ status == ReturnApplyOrderTypeReturnForRefund.value ? '退货' : '退款'}</Text>
      </View>}
    </>
  )
}
export default memo(OrderStatusTag)
